merged: Log NodeIds for easier diagnosis of debug.log

This commit is contained in:
R E Broadley 2014-06-20 20:09:06 +07:00 committed by Evan Duffield
parent 3b541724e2
commit 5bdb5abb0a

View File

@ -4374,10 +4374,10 @@ bool static ProcessMessage(CNode* pfrom, string strCommand, CDataStream& vRecv)
}
if (fDebugNet || (vInv.size() != 1))
printf("received getdata (%"PRIszu" invsz)\n", vInv.size());
printf("received getdata (%"PRIszu" invsz) peer=%d\n", vInv.size(), pfrom->id);
if ((fDebugNet && vInv.size() > 0) || (vInv.size() == 1))
printf("received getdata for: %s\n", vInv[0].ToString().c_str());
printf("received getdata for: %s peer=%d\n", vInv[0].ToString().c_str(), pfrom->id);
pfrom->vRecvGetData.insert(pfrom->vRecvGetData.end(), vInv.begin(), vInv.end());
ProcessGetData(pfrom);
@ -4397,7 +4397,7 @@ bool static ProcessMessage(CNode* pfrom, string strCommand, CDataStream& vRecv)
if (pindex)
pindex = pindex->pnext;
int nLimit = 500;
printf("getblocks %d to %s limit %d\n", (pindex ? pindex->nHeight : -1), hashStop.ToString().c_str(), nLimit);
printf("getblocks %d to %s limit %d peer=%d\n", (pindex ? pindex->nHeight : -1), hashStop==uint256(0) ? "0" : hashStop.ToString().c_str(), nLimit, pfrom->id);
for (; pindex; pindex = pindex->pnext)
{
if (pindex->GetBlockHash() == hashStop)
@ -4541,7 +4541,7 @@ bool static ProcessMessage(CNode* pfrom, string strCommand, CDataStream& vRecv)
CBlock block;
vRecv >> block;
printf("received block %s\n", block.GetHash().ToString().c_str());
printf("received block %s peer=%d\n", block.GetHash().ToString().c_str(), pfrom->id);
// block.print();
CInv inv(MSG_BLOCK, block.GetHash());
@ -5009,7 +5009,7 @@ bool SendMessages(CNode* pto, bool fSendTrickle)
if (!AlreadyHave(inv))
{
if (fDebugNet)
printf("sending getdata: %s\n", inv.ToString().c_str());
printf("sending getdata: %s peer=%d\n", inv.ToString().c_str(), pto->id);
vGetData.push_back(inv);
if (vGetData.size() >= 1000)
{