Skip to content

Commit 5c63d87

Browse files
committed
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.
1 parent 3721f3a commit 5c63d87

File tree

1 file changed

+4
-0
lines changed
  • beacon_node/lighthouse_network/src/peer_manager

1 file changed

+4
-0
lines changed

beacon_node/lighthouse_network/src/peer_manager/peerdb.rs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -847,6 +847,10 @@ impl<TSpec: EthSpec> PeerDB<TSpec> {
847847
PeerConnectionStatus::Disconnecting { .. } => {
848848
// The peer has been disconnected but not banned. Inform the peer manager
849849
// that this peer could be eligible for a temporary ban.
850+
self.disconnected_peers += 1;
851+
info.set_connection_status(PeerConnectionStatus::Disconnected {
852+
since: Instant::now(),
853+
});
850854
return Some(BanOperation::TemporaryBan);
851855
}
852856
PeerConnectionStatus::Unknown

0 commit comments

Comments
 (0)