new ContactList(key, contactsopt)
State machine used for sorting through Contacts during a Node#iterativeFindNode lookup.
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
key | string | 160 bit hex reference key for distance caluclation | |
contacts | Array.<module:kdns/contacts~Contact> | <optional> | List to initialize with |
- Source
Members
active
PropertiesName | Type | Description |
---|---|---|
active | Array.<module:kdns/contacts~Contact> | Contacts in the list that are active |
- Source
closest
PropertiesName | Type | Description |
---|---|---|
closest | module:kdns/contacts~Contact | The contact closest to the reference key |
- Source
uncontacted
PropertiesName | Type | Description |
---|---|---|
uncontacted | Array.<module:kdns/contacts~Contact> | Contacts in the list that have not been contacted |
- Source
Methods
add(contacts) → {Array.<module:kdns/contacts~Contact>}
Adds the given contacts to the list
Parameters:
Name | Type | Description |
---|---|---|
contacts | Array.<module:kdns/contacts~Contact> | Contacts to add to the list |
- Source
Returns:
added - Contacts added to the list
- Type:
- Array.<module:kdns/contacts~Contact>
contacted(contact) → {undefined}
Marks the supplied contact as contacted
Parameters:
Name | Type | Description |
---|---|---|
contact | module:kdns/contacts~Contact | Mark as contacted |
- Source
Returns:
- Type:
- undefined
responded(contact) → {undefined}
Marks the supplied contact as active
Parameters:
Name | Type | Description |
---|---|---|
contact | module:kdns/contacts~Contact | Mark as responded |
- Source
Returns:
- Type:
- undefined