File tree Expand file tree Collapse file tree 1 file changed +15
-1
lines changed
stackslib/src/net/neighbors Expand file tree Collapse file tree 1 file changed +15
-1
lines changed Original file line number Diff line number Diff line change @@ -223,7 +223,7 @@ pub trait NeighborWalkDB {
223
223
e
224
224
} ) ;
225
225
226
- let mut next_neighbors = if let Ok ( neighbors) = next_neighbors_res {
226
+ let db_neighbors = if let Ok ( neighbors) = next_neighbors_res {
227
227
neighbors
228
228
} else {
229
229
let any_neighbors = Self :: pick_walk_neighbors ( network, ( NUM_NEIGHBORS as u64 ) * 2 , 0 )
@@ -238,6 +238,20 @@ pub trait NeighborWalkDB {
238
238
239
239
any_neighbors
240
240
} ;
241
+
242
+ let mut next_neighbors: Vec < _ > = db_neighbors
243
+ . into_iter ( )
244
+ . filter_map ( |neighbor| {
245
+ if network. get_connection_opts ( ) . private_neighbors
246
+ && neighbor. addr . addrbytes . is_in_private_range ( )
247
+ {
248
+ None
249
+ } else {
250
+ Some ( neighbor)
251
+ }
252
+ } )
253
+ . collect ( ) ;
254
+
241
255
if next_neighbors. len ( ) == 0 {
242
256
return Err ( net_error:: NoSuchNeighbor ) ;
243
257
}
You can’t perform that action at this time.
0 commit comments