diff --git a/src/addrman.cpp b/src/addrman.cpp index d0b820ee651..a351b6fbc57 100644 --- a/src/addrman.cpp +++ b/src/addrman.cpp @@ -818,6 +818,7 @@ std::vector AddrManImpl::GetAddr_(size_t max_addresses, size_t max_pct // gather a list of random nodes, skipping those of low quality const auto now{Now()}; std::vector addresses; + addresses.reserve(nNodes); for (unsigned int n = 0; n < vRandom.size(); n++) { if (addresses.size() >= nNodes) break;