kdns/contacts~ ContactList

new ContactList(key, contactsopt)

State machine used for sorting through Contacts during a Node#iterativeFindNode lookup.

Parameters:
NameTypeAttributesDescription
keystring

160 bit hex reference key for distance caluclation

contactsArray.<module:kdns/contacts~Contact><optional>

List to initialize with

Members

active

Properties
NameTypeDescription
activeArray.<module:kdns/contacts~Contact>

Contacts in the list that are active

closest

Properties
NameTypeDescription
closestmodule:kdns/contacts~Contact

The contact closest to the reference key

uncontacted

Properties
NameTypeDescription
uncontactedArray.<module:kdns/contacts~Contact>

Contacts in the list that have not been contacted

Methods

add(contacts) → {Array.<module:kdns/contacts~Contact>}

Adds the given contacts to the list

Parameters:
NameTypeDescription
contactsArray.<module:kdns/contacts~Contact>

Contacts to add to the list

Returns:

added - Contacts added to the list

Type: 
Array.<module:kdns/contacts~Contact>

contacted(contact) → {undefined}

Marks the supplied contact as contacted

Parameters:
NameTypeDescription
contactmodule:kdns/contacts~Contact

Mark as contacted

Returns:
Type: 
undefined

responded(contact) → {undefined}

Marks the supplied contact as active

Parameters:
NameTypeDescription
contactmodule:kdns/contacts~Contact

Mark as responded

Returns:
Type: 
undefined