diff --git a/src/addrman.cpp b/src/addrman.cpp index 76fcb6bcc5..0a886bbe3e 100644 --- a/src/addrman.cpp +++ b/src/addrman.cpp @@ -758,7 +758,8 @@ std::pair AddrManImpl::Select_(bool new_only, const std:: // Iterate over the positions of that bucket, starting at the initial one, // and looping around. - int i, position, node_id = 0; + int i, position; + nid_type node_id = 0; for (i = 0; i < ADDRMAN_BUCKET_SIZE; ++i) { position = (initial_position + i) % ADDRMAN_BUCKET_SIZE; node_id = GetEntry(search_tried, bucket, position); @@ -791,7 +792,7 @@ std::pair AddrManImpl::Select_(bool new_only, const std:: } } -int AddrManImpl::GetEntry(bool use_tried, size_t bucket, size_t position) const +nid_type AddrManImpl::GetEntry(bool use_tried, size_t bucket, size_t position) const { AssertLockHeld(cs); @@ -854,7 +855,7 @@ std::vector> AddrManImpl::GetEntries_(bool std::vector> infos; for (int bucket = 0; bucket < bucket_count; ++bucket) { for (int position = 0; position < ADDRMAN_BUCKET_SIZE; ++position) { - int id = GetEntry(from_tried, bucket, position); + nid_type id = GetEntry(from_tried, bucket, position); if (id >= 0) { AddrInfo info = mapInfo.at(id); AddressPosition location = AddressPosition( diff --git a/src/addrman_impl.h b/src/addrman_impl.h index cbc4234645..a0390b7154 100644 --- a/src/addrman_impl.h +++ b/src/addrman_impl.h @@ -263,9 +263,9 @@ private: /** Helper to generalize looking up an addrman entry from either table. * - * @return int The nid of the entry. If the addrman position is empty or not found, returns -1. + * @return nid_type The nid of the entry. If the addrman position is empty or not found, returns -1. * */ - int GetEntry(bool use_tried, size_t bucket, size_t position) const EXCLUSIVE_LOCKS_REQUIRED(cs); + nid_type GetEntry(bool use_tried, size_t bucket, size_t position) const EXCLUSIVE_LOCKS_REQUIRED(cs); std::vector GetAddr_(size_t max_addresses, size_t max_pct, std::optional network, const bool filtered = true) const EXCLUSIVE_LOCKS_REQUIRED(cs);