Functions§
- add_
node_ task - Add a node to the DHT buckets.
If the bucket is already full, we ping the least recently seen node in the
bucket: if successful it becomes the most recently seen node, if the ping
fails we remove it and add the new node.
crate::dht::Dht::update_node()increments a channel’s usage count (in the direct session) and triggers this task. This task decrements the usage count usingcrate::dht::Dht::cleanup_channel(). - channel_
task - Send a DHT ping request when there is a new channel, to know the node id of the new peer, Then fill the channel cache and the buckets
- cleanup_
channels_ task - Removes entries from
crate::dht::Dht::channel_cachewhen a channel is stopped. - dht_
refinery_ task - Periodically send a DHT ping to known hosts. If the ping is successful, we move the host to the whitelist (updating the last seen field).
- disconnect_
inbounds_ task - Close inbound connections that are unused for too long.
- events_
task - Handle DHT events.