Radish alpha
h
Radicle Heartwood Protocol & Stack
Radicle
Git (anonymous pull)
Log in to clone via SSH
node: Randomize order of missing inventories
cloudhead committed 1 year ago
commit 189046bb5d2c871028ac0a0ece7231ed49bfafae
parent aac23dde0c5dcaf3861ccf6b78181b2cbc07ab7a
1 file changed +6 -0
modified radicle-node/src/service.rs
@@ -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);