Randomize the order of addr processing

This commit is contained in:
Pieter Wuille
2021-07-15 12:59:23 -07:00
parent 0d64b8f709
commit 5648138f59
2 changed files with 4 additions and 1 deletions

View File

@@ -2804,6 +2804,7 @@ void PeerManagerImpl::ProcessMessage(CNode& pfrom, const std::string& msg_type,
peer->m_addr_token_timestamp = current_time;
const bool rate_limited = !pfrom.HasPermission(NetPermissionFlags::Addr);
Shuffle(vAddr.begin(), vAddr.end(), FastRandomContext());
for (CAddress& addr : vAddr)
{
if (interruptMsgProc)