add_node_task

Function add_node_task 

Source
pub async fn add_node_task<H: DhtHandler>(handler: Arc<H>) -> Result<()>
Expand description

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 using crate::dht::Dht::cleanup_channel().