@@ -757,10 +757,10 @@ std::pair<CAddress, NodeSeconds> AddrManImpl::Select_(bool new_only, std::option
757
757
758
758
// Iterate over the positions of that bucket, starting at the initial one,
759
759
// and looping around.
760
- int i;
760
+ int i, position, node_id ;
761
761
for (i = 0 ; i < ADDRMAN_BUCKET_SIZE; ++i) {
762
- int position = (initial_position + i) % ADDRMAN_BUCKET_SIZE;
763
- int node_id = GetEntry (search_tried, bucket, position);
762
+ position = (initial_position + i) % ADDRMAN_BUCKET_SIZE;
763
+ node_id = GetEntry (search_tried, bucket, position);
764
764
if (node_id != -1 ) {
765
765
if (network.has_value ()) {
766
766
const auto it{mapInfo.find (node_id)};
@@ -777,9 +777,7 @@ std::pair<CAddress, NodeSeconds> AddrManImpl::Select_(bool new_only, std::option
777
777
if (i == ADDRMAN_BUCKET_SIZE) continue ;
778
778
779
779
// Find the entry to return.
780
- int position = (initial_position + i) % ADDRMAN_BUCKET_SIZE;
781
- int nId = GetEntry (search_tried, bucket, position);
782
- const auto it_found{mapInfo.find (nId)};
780
+ const auto it_found{mapInfo.find (node_id)};
783
781
assert (it_found != mapInfo.end ());
784
782
const AddrInfo& info{it_found->second };
785
783
0 commit comments