mirror of
https://github.com/sigp/lighthouse.git
synced 2026-03-19 21:04:41 +00:00
Filter Disconnected Peers from Discv5 DHT (#2219)
## Issue Addressed #2107 ## Proposed Change The peer manager will mark peers as disconnected in the discv5 DHT when they disconnect or dial fails ## Additional Info Rationale for this particular change is explained in my comment on #2107
This commit is contained in:
@@ -514,6 +514,13 @@ impl<TSpec: EthSpec> Discovery<TSpec> {
|
||||
}
|
||||
}
|
||||
|
||||
// mark node as disconnected in DHT, freeing up space for other nodes
|
||||
pub fn disconnect_peer(&mut self, peer_id: &PeerId) {
|
||||
if let Ok(node_id) = peer_id_to_node_id(peer_id) {
|
||||
self.discv5.disconnect_node(&node_id);
|
||||
}
|
||||
}
|
||||
|
||||
/* Internal Functions */
|
||||
|
||||
/// Adds a subnet query if one doesn't exist. If a subnet query already exists, this
|
||||
|
||||
Reference in New Issue
Block a user