diff --git a/substrate/client/network/src/protocol/notifications/behaviour.rs b/substrate/client/network/src/protocol/notifications/behaviour.rs index 84f15c8be3..f95f6870e5 100644 --- a/substrate/client/network/src/protocol/notifications/behaviour.rs +++ b/substrate/client/network/src/protocol/notifications/behaviour.rs @@ -1851,9 +1851,10 @@ impl NetworkBehaviour for Notifications { trace!(target: "sub-libp2p", "PSM <= Dropped({:?})", source); self.peerset.dropped(set_id, source.clone(), sc_peerset::DropReason::Refused); + let ban_dur = Uniform::new(5, 10).sample(&mut rand::thread_rng()); *entry.into_mut() = PeerState::Disabled { connections, - backoff_until: None + backoff_until: Some(Instant::now() + Duration::from_secs(ban_dur)) }; } else { *entry.into_mut() = PeerState::Enabled { connections };