Merge #8154: drop vAddrToSend after sending big addr message

d3d02d5 drop vAddrToSend after sending big addr message (Kaz Wesley)
This commit is contained in:
Wladimir J. van der Laan 2016-06-09 08:13:11 +02:00
commit 1445835bd3
No known key found for this signature in database
GPG key ID: 74810B012346C9A6

View file

@ -5725,6 +5725,9 @@ bool SendMessages(CNode* pto)
pto->vAddrToSend.clear();
if (!vAddr.empty())
pto->PushMessage(NetMsgType::ADDR, vAddr);
// we only send the big addr message once
if (pto->vAddrToSend.capacity() > 40)
pto->vAddrToSend.shrink_to_fit();
}
CNodeState &state = *State(pto->GetId());