Fix a very rare bug where DHT paniced
This commit is contained in:
parent
559fca8552
commit
963f8167de
3 changed files with 14 additions and 30 deletions
|
|
@ -971,9 +971,10 @@ impl DhtWorker {
|
|||
loop {
|
||||
interval.tick().await;
|
||||
let mut found = 0;
|
||||
let now = Instant::now();
|
||||
for node in self.dht.routing_table.read().iter() {
|
||||
if matches!(
|
||||
node.status(),
|
||||
node.status(now),
|
||||
NodeStatus::Questionable | NodeStatus::Unknown
|
||||
) {
|
||||
found += 1;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue