Merge #1186: Added logging of sent inv messages

This commit is contained in:
Tim Flynn 2016-12-03 16:33:30 -05:00 committed by Holger Schinzel
parent 8126e92441
commit 786f17e1f2

View File

@ -6674,6 +6674,7 @@ bool SendMessages(CNode* pto)
if (fTrickleWait)
{
LogPrint("net", "SendMessages -- queued inv(vInvWait): %s index=%d peer=%d\n", inv.ToString(), vInvWait.size(), pto->id);
vInvWait.push_back(inv);
continue;
}
@ -6681,17 +6682,21 @@ bool SendMessages(CNode* pto)
pto->filterInventoryKnown.insert(inv.hash);
LogPrint("net", "SendMessages -- queued inv: %s index=%d peer=%d\n", inv.ToString(), vInv.size(), pto->id);
vInv.push_back(inv);
if (vInv.size() >= 1000)
{
LogPrint("net", "SendMessages -- pushing inv's: count=%d peer=%d\n", vInv.size(), pto->id);
pto->PushMessage(NetMsgType::INV, vInv);
vInv.clear();
}
}
pto->vInventoryToSend = vInvWait;
}
if (!vInv.empty())
if (!vInv.empty()) {
LogPrint("net", "SendMessages -- pushing tailing inv's: count=%d peer=%d\n", vInv.size(), pto->id);
pto->PushMessage(NetMsgType::INV, vInv);
}
// Detect whether we're stalling
nNow = GetTimeMicros();