Skip to content

Commit 7b597c3

Browse files
committed
fix: don't stop an ongoing walk just because we don't yet have a connection to an always-allowed peer
1 parent 683931c commit 7b597c3

File tree

2 files changed

+2
-20
lines changed

2 files changed

+2
-20
lines changed

stackslib/src/net/neighbors/mod.rs

Lines changed: 2 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -303,27 +303,10 @@ impl PeerNetwork {
303303
/// Returns true if we instantiated the walk.
304304
/// Returns false if not.
305305
fn setup_walk(&mut self, ibd: bool) -> bool {
306-
// we unconditionally need to begin walking if we're not connected to any always-allowed
307-
// peer
308-
let mut need_new_peers = false;
309-
let (num_always_connected, total_always_connected) = self
310-
.count_connected_always_allowed_peers()
311-
.unwrap_or((0, 0));
312-
if num_always_connected == 0 && total_always_connected > 0 {
313-
// force a reset
314-
debug!("{:?}: not connected to any always-allowed peers; forcing a walk reset to try and fix this", &self.local_peer);
315-
self.reset_walk();
316-
317-
// TODO: force choosing an always-allowed peer!
318-
//
319-
need_new_peers = true;
320-
}
321-
322306
if self.walk.is_none() {
323307
// time to do a walk yet?
324-
if !need_new_peers
325-
&& (self.walk_count > self.connection_opts.num_initial_walks
326-
|| self.walk_retries > self.connection_opts.walk_retry_count)
308+
if (self.walk_count > self.connection_opts.num_initial_walks
309+
|| self.walk_retries > self.connection_opts.walk_retry_count)
327310
&& self.walk_deadline > get_epoch_time_secs()
328311
{
329312
// we've done enough walks for an initial mixing, or we can't connect to anyone,

stackslib/src/net/neighbors/walk.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -565,7 +565,6 @@ impl<DB: NeighborWalkDB, NC: NeighborComms> NeighborWalk<DB, NC> {
565565
}
566566

567567
/// Select neighbors that are routable, and ignore ones that are not.
568-
/// TODO: expand if we ever want to filter by unroutable network class or something
569568
fn filter_sensible_neighbors(
570569
mut neighbors: Vec<NeighborAddress>,
571570
private_neighbors: bool,

0 commit comments

Comments
 (0)