node: Randomize order of missing inventories
This commit is contained in:
parent
aac23dde0c
commit
189046bb5d
|
|
@ -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 {
|
for rid in missing {
|
||||||
debug!(target: "service", "Missing seeded inventory {rid}; initiating fetch..");
|
debug!(target: "service", "Missing seeded inventory {rid}; initiating fetch..");
|
||||||
self.fetch(rid, *announcer, FETCH_TIMEOUT, None);
|
self.fetch(rid, *announcer, FETCH_TIMEOUT, None);
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue