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.
This commit is contained in:
parent
3721f3a83c
commit
5c63d8758e
@ -847,6 +847,10 @@ impl<TSpec: EthSpec> PeerDB<TSpec> {
|
|||||||
PeerConnectionStatus::Disconnecting { .. } => {
|
PeerConnectionStatus::Disconnecting { .. } => {
|
||||||
// The peer has been disconnected but not banned. Inform the peer manager
|
// The peer has been disconnected but not banned. Inform the peer manager
|
||||||
// that this peer could be eligible for a temporary ban.
|
// 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);
|
return Some(BanOperation::TemporaryBan);
|
||||||
}
|
}
|
||||||
PeerConnectionStatus::Unknown
|
PeerConnectionStatus::Unknown
|
||||||
|
Loading…
Reference in New Issue
Block a user