mirror of
https://seed.radicle.dev/rad:z3gqcJUoA1n9HaHKufZs5FCSGazv5.git
synced 2026-11-29 05:50:31 +08:00
node: Randomize order of missing inventories
This commit is contained in:
@@ -1602,6 +1602,12 @@ where
|
||||
}
|
||||
}
|
||||
}
|
||||
// Since we have limited fetch capacity, it may be that we can't fetch an entire
|
||||
// inventory from a peer. Therefore we randomize the order of the RIDs to fetch
|
||||
// different RIDs from different peers in case multiple peers announce the same
|
||||
// RIDs.
|
||||
self.rng.shuffle(&mut missing);
|
||||
|
||||
for rid in missing {
|
||||
debug!(target: "service", "Missing seeded inventory {rid}; initiating fetch..");
|
||||
self.fetch(rid, *announcer, FETCH_TIMEOUT, None);
|
||||
|
||||
Reference in New Issue
Block a user