mirror of
https://github.com/mimblewimble/grin.git
synced 2025-02-01 17:01:09 +03:00
Fix seed thread crash (#2096)
We get overflow in some tests, peraps in real life too Fixes #2095
This commit is contained in:
parent
d1b484259b
commit
a6bb6344ac
1 changed files with 3 additions and 1 deletions
|
@ -409,7 +409,9 @@ impl Peers {
|
|||
}
|
||||
|
||||
// ensure we do not still have too many connected peers
|
||||
let excess_count = (self.peer_count() as usize - rm.len()).saturating_sub(max_count);
|
||||
let excess_count = (self.peer_count() as usize)
|
||||
.saturating_sub(rm.len())
|
||||
.saturating_sub(max_count);
|
||||
if excess_count > 0 {
|
||||
// map peers to addrs in a block to bound how long we keep the read lock for
|
||||
let mut addrs = self
|
||||
|
|
Loading…
Reference in a new issue