File tree Expand file tree Collapse file tree 1 file changed +9
-2
lines changed
stackslib/src/net/neighbors Expand file tree Collapse file tree 1 file changed +9
-2
lines changed Original file line number Diff line number Diff line change @@ -213,9 +213,14 @@ impl PeerNetwork {
213
213
& self . local_peer, self . walk_attempts
214
214
) ;
215
215
216
+ let ( num_always_connected, total_always_connected) = self
217
+ . count_connected_always_allowed_peers ( )
218
+ . unwrap_or ( ( 0 , 0 ) ) ;
219
+
216
220
// always ensure we're connected to always-allowed outbound peers
217
- let walk_res = if ibd {
218
- // always connect to bootstrap peers if in IBD
221
+ let walk_res = if ibd || ( num_always_connected == 0 && total_always_connected > 0 ) {
222
+ // always connect to bootstrap peers if in IBD, or if we're not connected to an
223
+ // always-allowed peer already
219
224
NeighborWalk :: instantiate_walk_to_always_allowed (
220
225
self . get_neighbor_walk_db ( ) ,
221
226
self . get_neighbor_comms ( ) ,
@@ -309,6 +314,8 @@ impl PeerNetwork {
309
314
debug ! ( "{:?}: not connected to any always-allowed peers; forcing a walk reset to try and fix this" , & self . local_peer) ;
310
315
self . reset_walk ( ) ;
311
316
317
+ // TODO: force choosing an always-allowed peer!
318
+ //
312
319
need_new_peers = true ;
313
320
}
314
321
You can’t perform that action at this time.
0 commit comments