mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-04-26 12:17:58 +00:00
Make sure nodes don't hammer each other even when reserved (#8901)
* Make sure nodes don't hammer each other even when reserved * Make the ban random
This commit is contained in:
@@ -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 };
|
||||
|
||||
Reference in New Issue
Block a user