Skip to content

Commit 53855fe

Browse files
committed
chore: cleanup commented out code in stackerdb::sync
1 parent 5ee3152 commit 53855fe

File tree

1 file changed

+4
-7
lines changed

1 file changed

+4
-7
lines changed

stackslib/src/net/stackerdb/sync.rs

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1039,16 +1039,13 @@ impl<NC: NeighborComms> StackerDBSync<NC> {
10391039
}
10401040

10411041
let chunk_push = self.chunk_push_priorities[cur_priority].0.clone();
1042+
// try the first neighbor in the chunk_push_priorities list
10421043
let selected_neighbor_opt = self.chunk_push_priorities[cur_priority]
10431044
.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));
10481047

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 {
10521049
debug!("{:?}: pushchunks_begin: no available neighbor to send StackerDBChunk(db={},id={},ver={}) to",
10531050
&network.get_local_peer(),
10541051
&self.smart_contract_id,

0 commit comments

Comments
 (0)