mirror of
https://github.com/darkrenaissance/darkfi.git
synced 2026-04-28 03:00:18 -04:00
seedsync_session: fix deceptive logic on failed()
We should return an error when ALL seed slots have failed, not ANY.
Otherwise this would print a deceptive error message ("Network reseed failed") if
we have e.g. 2 seed slots and one seeds successfully and the other fails.
This commit is contained in:
@@ -127,9 +127,10 @@ impl SeedSyncSession {
|
||||
debug!(target: "net::seedsync_session", "Seed sync session stopped!");
|
||||
}
|
||||
|
||||
/// Returns true if every seed attempt per slot has failed.
|
||||
pub(crate) async fn failed(&self) -> bool {
|
||||
let slots = &*self.slots.lock().await;
|
||||
slots.iter().any(|s| s.failed())
|
||||
slots.iter().all(|s| s.failed())
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user