mirror of
https://github.com/sigp/lighthouse.git
synced 2026-03-09 03:31:45 +00:00
Ignore RPC messages of disconnected peers and remove old peers based on disconnection time (#1854)
## Issue Addressed NA ## Proposed Changes Lets the networking behavior ignore messages of peers that are not connected. Furthermore, old peers are not removed from the peerdb based on score anymore but based on the disconnection time.
This commit is contained in:
@@ -316,6 +316,10 @@ impl<TSpec: EthSpec> PeerManager<TSpec> {
|
||||
self.network_globals.peers.read().is_banned(peer_id)
|
||||
}
|
||||
|
||||
pub fn is_connected(&self, peer_id: &PeerId) -> bool {
|
||||
self.network_globals.peers.read().is_connected(peer_id)
|
||||
}
|
||||
|
||||
/// Reports whether the peer limit is reached in which case we stop allowing new incoming
|
||||
/// connections.
|
||||
pub fn peer_limit_reached(&self) -> bool {
|
||||
|
||||
Reference in New Issue
Block a user