@@ -3547,7 +3547,7 @@ void static ProcessGetData(CNode* pfrom)
3547
3547
bool static ProcessMessage (CNode* pfrom, string strCommand, CDataStream& vRecv)
3548
3548
{
3549
3549
RandAddSeedPerfmon ();
3550
- LogPrint (" net" , " received: %s (%u bytes)\n " , strCommand, vRecv.size ());
3550
+ LogPrint (" net" , " received: %s (%u bytes) peer=%d \n " , strCommand, vRecv.size (), pfrom-> id );
3551
3551
if (mapArgs.count (" -dropmessagestest" ) && GetRand (atoi (mapArgs[" -dropmessagestest" ])) == 0 )
3552
3552
{
3553
3553
LogPrintf (" dropmessagestest DROPPING RECV MESSAGE\n " );
@@ -3579,7 +3579,7 @@ bool static ProcessMessage(CNode* pfrom, string strCommand, CDataStream& vRecv)
3579
3579
if (pfrom->nVersion < MIN_PEER_PROTO_VERSION)
3580
3580
{
3581
3581
// disconnect from peers older than this proto version
3582
- LogPrintf (" partner %s using obsolete version %i; disconnecting\n " , pfrom->addr . ToString () , pfrom->nVersion );
3582
+ LogPrintf (" peer=%d using obsolete version %i; disconnecting\n " , pfrom->id , pfrom->nVersion );
3583
3583
pfrom->PushMessage (" reject" , strCommand, REJECT_OBSOLETE,
3584
3584
strprintf (" Version must be %d or greater" , MIN_PEER_PROTO_VERSION));
3585
3585
pfrom->fDisconnect = true ;
@@ -3660,7 +3660,7 @@ bool static ProcessMessage(CNode* pfrom, string strCommand, CDataStream& vRecv)
3660
3660
3661
3661
pfrom->fSuccessfullyConnected = true ;
3662
3662
3663
- LogPrintf (" receive version message: %s: version %d, blocks=%d, us=%s, them=%s, peer=%s \n " , pfrom->cleanSubVer , pfrom->nVersion , pfrom->nStartingHeight , addrMe.ToString (), addrFrom. ToString (), pfrom->addr . ToString () );
3663
+ LogPrintf (" receive version message: %s: version %d, blocks=%d, us=%s, peer=%d \n " , pfrom->cleanSubVer , pfrom->nVersion , pfrom->nStartingHeight , addrMe.ToString (), pfrom->id );
3664
3664
3665
3665
AddTimeData (pfrom->addr , nTime);
3666
3666
}
@@ -3767,7 +3767,7 @@ bool static ProcessMessage(CNode* pfrom, string strCommand, CDataStream& vRecv)
3767
3767
pfrom->AddInventoryKnown (inv);
3768
3768
3769
3769
bool fAlreadyHave = AlreadyHave (inv);
3770
- LogPrint (" net" , " got inventory : %s %s\n " , inv.ToString (), fAlreadyHave ? " have" : " new" );
3770
+ LogPrint (" net" , " got inv : %s %s peer=%d \n " , inv.ToString (), fAlreadyHave ? " have" : " new" , pfrom-> id );
3771
3771
3772
3772
if (!fAlreadyHave ) {
3773
3773
if (!fImporting && !fReindex ) {
@@ -3800,10 +3800,10 @@ bool static ProcessMessage(CNode* pfrom, string strCommand, CDataStream& vRecv)
3800
3800
}
3801
3801
3802
3802
if (fDebug || (vInv.size () != 1 ))
3803
- LogPrint (" net" , " received getdata (%u invsz)\n " , vInv.size ());
3803
+ LogPrint (" net" , " received getdata (%u invsz) peer=%d \n " , vInv.size (), pfrom-> id );
3804
3804
3805
3805
if ((fDebug && vInv.size () > 0 ) || (vInv.size () == 1 ))
3806
- LogPrint (" net" , " received getdata for: %s\n " , vInv[0 ].ToString ());
3806
+ LogPrint (" net" , " received getdata for: %s peer=%d \n " , vInv[0 ].ToString (), pfrom-> id );
3807
3807
3808
3808
pfrom->vRecvGetData .insert (pfrom->vRecvGetData .end (), vInv.begin (), vInv.end ());
3809
3809
ProcessGetData (pfrom);
@@ -3825,7 +3825,7 @@ bool static ProcessMessage(CNode* pfrom, string strCommand, CDataStream& vRecv)
3825
3825
if (pindex)
3826
3826
pindex = chainActive.Next (pindex);
3827
3827
int nLimit = 500 ;
3828
- LogPrint (" net" , " getblocks %d to %s limit %d\n " , (pindex ? pindex->nHeight : -1 ), hashStop==uint256 (0 ) ? " end" : hashStop.ToString (), nLimit);
3828
+ LogPrint (" net" , " getblocks %d to %s limit %d from peer=%d \n " , (pindex ? pindex->nHeight : -1 ), hashStop==uint256 (0 ) ? " end" : hashStop.ToString (), nLimit, pfrom-> id );
3829
3829
for (; pindex; pindex = chainActive.Next (pindex))
3830
3830
{
3831
3831
if (pindex->GetBlockHash () == hashStop)
@@ -3908,8 +3908,8 @@ bool static ProcessMessage(CNode* pfrom, string strCommand, CDataStream& vRecv)
3908
3908
vEraseQueue.push_back (inv.hash );
3909
3909
3910
3910
3911
- LogPrint (" mempool" , " AcceptToMemoryPool: %s %s : accepted %s (poolsz %u)\n " ,
3912
- pfrom->addr . ToString () , pfrom->cleanSubVer ,
3911
+ LogPrint (" mempool" , " AcceptToMemoryPool: peer=%d %s : accepted %s (poolsz %u)\n " ,
3912
+ pfrom->id , pfrom->cleanSubVer ,
3913
3913
tx.GetHash ().ToString (),
3914
3914
mempool.mapTx .size ());
3915
3915
@@ -3962,8 +3962,8 @@ bool static ProcessMessage(CNode* pfrom, string strCommand, CDataStream& vRecv)
3962
3962
int nDoS = 0 ;
3963
3963
if (state.IsInvalid (nDoS))
3964
3964
{
3965
- LogPrint (" mempool" , " %s from %s %s was not accepted into the memory pool: %s\n " , tx.GetHash ().ToString (),
3966
- pfrom->addr . ToString () , pfrom->cleanSubVer ,
3965
+ LogPrint (" mempool" , " %s from peer=%d %s was not accepted into the memory pool: %s\n " , tx.GetHash ().ToString (),
3966
+ pfrom->id , pfrom->cleanSubVer ,
3967
3967
state.GetRejectReason ());
3968
3968
pfrom->PushMessage (" reject" , strCommand, state.GetRejectCode (),
3969
3969
state.GetRejectReason (), inv.hash );
@@ -3978,7 +3978,7 @@ bool static ProcessMessage(CNode* pfrom, string strCommand, CDataStream& vRecv)
3978
3978
CBlock block;
3979
3979
vRecv >> block;
3980
3980
3981
- LogPrint (" net" , " received block %s\n " , block.GetHash ().ToString ());
3981
+ LogPrint (" net" , " received block %s peer=%d \n " , block.GetHash ().ToString (), pfrom-> id );
3982
3982
// block.print();
3983
3983
3984
3984
CInv inv (MSG_BLOCK, block.GetHash ());
@@ -4095,8 +4095,8 @@ bool static ProcessMessage(CNode* pfrom, string strCommand, CDataStream& vRecv)
4095
4095
}
4096
4096
4097
4097
if (!(sProblem .empty ())) {
4098
- LogPrint (" net" , " pong %s %s: %s, %x expected, %x received, %u bytes\n " ,
4099
- pfrom->addr . ToString () ,
4098
+ LogPrint (" net" , " pong peer=%d %s: %s, %x expected, %x received, %u bytes\n " ,
4099
+ pfrom->id ,
4100
4100
pfrom->cleanSubVer ,
4101
4101
sProblem ,
4102
4102
pfrom->nPingNonceSent ,
@@ -4336,7 +4336,7 @@ bool ProcessMessages(CNode* pfrom)
4336
4336
}
4337
4337
4338
4338
if (!fRet )
4339
- LogPrintf (" ProcessMessage(%s, %u bytes) FAILED\n " , strCommand, nMessageSize);
4339
+ LogPrintf (" ProcessMessage(%s, %u bytes) FAILED peer=%d \n " , strCommand, nMessageSize, pfrom-> id );
4340
4340
4341
4341
break ;
4342
4342
}
@@ -4540,7 +4540,7 @@ bool SendMessages(CNode* pto, bool fSendTrickle)
4540
4540
uint256 hash = state.vBlocksToDownload .front ();
4541
4541
vGetData.push_back (CInv (MSG_BLOCK, hash));
4542
4542
MarkBlockAsInFlight (pto->GetId (), hash);
4543
- LogPrint (" net" , " Requesting block %s from %s \n " , hash.ToString (), state. name );
4543
+ LogPrint (" net" , " Requesting block %s peer=%d \n " , hash.ToString (), pto-> id );
4544
4544
if (vGetData.size () >= 1000 )
4545
4545
{
4546
4546
pto->PushMessage (" getdata" , vGetData);
@@ -4557,7 +4557,7 @@ bool SendMessages(CNode* pto, bool fSendTrickle)
4557
4557
if (!AlreadyHave (inv))
4558
4558
{
4559
4559
if (fDebug )
4560
- LogPrint (" net" , " sending getdata: %s \n " , inv.ToString ());
4560
+ LogPrint (" net" , " Requesting %s peer=%d \n " , inv.ToString (), pto-> id );
4561
4561
vGetData.push_back (inv);
4562
4562
if (vGetData.size () >= 1000 )
4563
4563
{
0 commit comments