handle empty node list before finding disconnected ip
This commit is contained in:
parent
eceafd9de8
commit
4f8f20bb84
@ -214,7 +214,10 @@ impl State {
|
||||
|
||||
let conn_ips = self.get_connected_ips().await;
|
||||
let nodes = self.nodes.read().await;
|
||||
let skip = OsRng.next_u64().try_into().unwrap_or(0) % nodes.len();
|
||||
if nodes.is_empty() {
|
||||
return None;
|
||||
}
|
||||
let skip = OsRng.next_u64() as usize % nodes.len();
|
||||
nodes
|
||||
.keys()
|
||||
.map(|ip| ip.to_string())
|
||||
|
Loading…
Reference in New Issue
Block a user