From 5c63d8758e35894660538ad205d9a1cacb9c7218 Mon Sep 17 00:00:00 2001 From: Age Manning Date: Tue, 21 Feb 2023 23:45:44 +0000 Subject: [PATCH] Register disconnected peers when temporarily banned (#4001) This is a correction to #3757. The correction registers a peer that is being disconnected in the local peer manager db to ensure we are tracking the correct state. --- beacon_node/lighthouse_network/src/peer_manager/peerdb.rs | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/beacon_node/lighthouse_network/src/peer_manager/peerdb.rs b/beacon_node/lighthouse_network/src/peer_manager/peerdb.rs index 61cf8de1cb..70d3399d6a 100644 --- a/beacon_node/lighthouse_network/src/peer_manager/peerdb.rs +++ b/beacon_node/lighthouse_network/src/peer_manager/peerdb.rs @@ -847,6 +847,10 @@ impl PeerDB { PeerConnectionStatus::Disconnecting { .. } => { // The peer has been disconnected but not banned. Inform the peer manager // that this peer could be eligible for a temporary ban. + self.disconnected_peers += 1; + info.set_connection_status(PeerConnectionStatus::Disconnected { + since: Instant::now(), + }); return Some(BanOperation::TemporaryBan); } PeerConnectionStatus::Unknown