File tree Expand file tree Collapse file tree 1 file changed +4
-7
lines changed
stackslib/src/net/stackerdb Expand file tree Collapse file tree 1 file changed +4
-7
lines changed Original file line number Diff line number Diff line change @@ -1039,16 +1039,13 @@ impl<NC: NeighborComms> StackerDBSync<NC> {
1039
1039
}
1040
1040
1041
1041
let chunk_push = self . chunk_push_priorities [ cur_priority] . 0 . clone ( ) ;
1042
+ // try the first neighbor in the chunk_push_priorities list
1042
1043
let selected_neighbor_opt = self . chunk_push_priorities [ cur_priority]
1043
1044
. 1
1044
- . iter ( )
1045
- . enumerate ( )
1046
- // .find(|(_i, naddr)| !self.comms.has_inflight(naddr));
1047
- . find ( |( _i, _naddr) | true ) ;
1045
+ . first ( )
1046
+ . map ( |neighbor| ( 0 , neighbor) ) ;
1048
1047
1049
- let ( idx, selected_neighbor) = if let Some ( x) = selected_neighbor_opt {
1050
- x
1051
- } else {
1048
+ let Some ( ( idx, selected_neighbor) ) = selected_neighbor_opt else {
1052
1049
debug ! ( "{:?}: pushchunks_begin: no available neighbor to send StackerDBChunk(db={},id={},ver={}) to" ,
1053
1050
& network. get_local_peer( ) ,
1054
1051
& self . smart_contract_id,
You can’t perform that action at this time.
0 commit comments