@@ -3538,7 +3538,7 @@ void static ProcessGetData(CNode* pfrom)
3538
3538
bool static ProcessMessage (CNode* pfrom, string strCommand, CDataStream& vRecv)
3539
3539
{
3540
3540
RandAddSeedPerfmon ();
3541
- LogPrint (" net" , " received: %s (%u bytes)\n " , strCommand, vRecv.size ());
3541
+ LogPrint (" net" , " received: %s (%u bytes) peer=%d \n " , strCommand, vRecv.size (), pfrom-> id );
3542
3542
if (mapArgs.count (" -dropmessagestest" ) && GetRand (atoi (mapArgs[" -dropmessagestest" ])) == 0 )
3543
3543
{
3544
3544
LogPrintf (" dropmessagestest DROPPING RECV MESSAGE\n " );
@@ -3570,7 +3570,7 @@ bool static ProcessMessage(CNode* pfrom, string strCommand, CDataStream& vRecv)
3570
3570
if (pfrom->nVersion < MIN_PEER_PROTO_VERSION)
3571
3571
{
3572
3572
// disconnect from peers older than this proto version
3573
- LogPrintf (" partner %s using obsolete version %i; disconnecting\n " , pfrom->addr . ToString () , pfrom->nVersion );
3573
+ LogPrintf (" peer=%d using obsolete version %i; disconnecting\n " , pfrom->id , pfrom->nVersion );
3574
3574
pfrom->PushMessage (" reject" , strCommand, REJECT_OBSOLETE,
3575
3575
strprintf (" Version must be %d or greater" , MIN_PEER_PROTO_VERSION));
3576
3576
pfrom->fDisconnect = true ;
@@ -3651,7 +3651,7 @@ bool static ProcessMessage(CNode* pfrom, string strCommand, CDataStream& vRecv)
3651
3651
3652
3652
pfrom->fSuccessfullyConnected = true ;
3653
3653
3654
- 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 () );
3654
+ LogPrintf (" receive version message: %s: version %d, blocks=%d, us=%s, peer=%d \n " , pfrom->cleanSubVer , pfrom->nVersion , pfrom->nStartingHeight , addrMe.ToString (), pfrom->id );
3655
3655
3656
3656
AddTimeData (pfrom->addr , nTime);
3657
3657
}
@@ -3758,7 +3758,7 @@ bool static ProcessMessage(CNode* pfrom, string strCommand, CDataStream& vRecv)
3758
3758
pfrom->AddInventoryKnown (inv);
3759
3759
3760
3760
bool fAlreadyHave = AlreadyHave (inv);
3761
- LogPrint (" net" , " got inventory : %s %s\n " , inv.ToString (), fAlreadyHave ? " have" : " new" );
3761
+ LogPrint (" net" , " got inv : %s %s peer=%d \n " , inv.ToString (), fAlreadyHave ? " have" : " new" , pfrom-> id );
3762
3762
3763
3763
if (!fAlreadyHave ) {
3764
3764
if (!fImporting && !fReindex ) {
@@ -3791,10 +3791,10 @@ bool static ProcessMessage(CNode* pfrom, string strCommand, CDataStream& vRecv)
3791
3791
}
3792
3792
3793
3793
if (fDebug || (vInv.size () != 1 ))
3794
- LogPrint (" net" , " received getdata (%u invsz)\n " , vInv.size ());
3794
+ LogPrint (" net" , " received getdata (%u invsz) peer=%d \n " , vInv.size (), pfrom-> id );
3795
3795
3796
3796
if ((fDebug && vInv.size () > 0 ) || (vInv.size () == 1 ))
3797
- LogPrint (" net" , " received getdata for: %s\n " , vInv[0 ].ToString ());
3797
+ LogPrint (" net" , " received getdata for: %s peer=%d \n " , vInv[0 ].ToString (), pfrom-> id );
3798
3798
3799
3799
pfrom->vRecvGetData .insert (pfrom->vRecvGetData .end (), vInv.begin (), vInv.end ());
3800
3800
ProcessGetData (pfrom);
@@ -3816,7 +3816,7 @@ bool static ProcessMessage(CNode* pfrom, string strCommand, CDataStream& vRecv)
3816
3816
if (pindex)
3817
3817
pindex = chainActive.Next (pindex);
3818
3818
int nLimit = 500 ;
3819
- LogPrint (" net" , " getblocks %d to %s limit %d\n " , (pindex ? pindex->nHeight : -1 ), hashStop==uint256 (0 ) ? " end" : hashStop.ToString (), nLimit);
3819
+ 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 );
3820
3820
for (; pindex; pindex = chainActive.Next (pindex))
3821
3821
{
3822
3822
if (pindex->GetBlockHash () == hashStop)
@@ -3899,8 +3899,8 @@ bool static ProcessMessage(CNode* pfrom, string strCommand, CDataStream& vRecv)
3899
3899
vEraseQueue.push_back (inv.hash );
3900
3900
3901
3901
3902
- LogPrint (" mempool" , " AcceptToMemoryPool: %s %s : accepted %s (poolsz %u)\n " ,
3903
- pfrom->addr . ToString () , pfrom->cleanSubVer ,
3902
+ LogPrint (" mempool" , " AcceptToMemoryPool: peer=%d %s : accepted %s (poolsz %u)\n " ,
3903
+ pfrom->id , pfrom->cleanSubVer ,
3904
3904
tx.GetHash ().ToString (),
3905
3905
mempool.mapTx .size ());
3906
3906
@@ -3953,8 +3953,8 @@ bool static ProcessMessage(CNode* pfrom, string strCommand, CDataStream& vRecv)
3953
3953
int nDoS = 0 ;
3954
3954
if (state.IsInvalid (nDoS))
3955
3955
{
3956
- LogPrint (" mempool" , " %s from %s %s was not accepted into the memory pool: %s\n " , tx.GetHash ().ToString (),
3957
- pfrom->addr . ToString () , pfrom->cleanSubVer ,
3956
+ LogPrint (" mempool" , " %s from peer=%d %s was not accepted into the memory pool: %s\n " , tx.GetHash ().ToString (),
3957
+ pfrom->id , pfrom->cleanSubVer ,
3958
3958
state.GetRejectReason ());
3959
3959
pfrom->PushMessage (" reject" , strCommand, state.GetRejectCode (),
3960
3960
state.GetRejectReason (), inv.hash );
@@ -3969,7 +3969,7 @@ bool static ProcessMessage(CNode* pfrom, string strCommand, CDataStream& vRecv)
3969
3969
CBlock block;
3970
3970
vRecv >> block;
3971
3971
3972
- LogPrint (" net" , " received block %s\n " , block.GetHash ().ToString ());
3972
+ LogPrint (" net" , " received block %s peer=%d \n " , block.GetHash ().ToString (), pfrom-> id );
3973
3973
// block.print();
3974
3974
3975
3975
CInv inv (MSG_BLOCK, block.GetHash ());
@@ -4086,8 +4086,8 @@ bool static ProcessMessage(CNode* pfrom, string strCommand, CDataStream& vRecv)
4086
4086
}
4087
4087
4088
4088
if (!(sProblem .empty ())) {
4089
- LogPrint (" net" , " pong %s %s: %s, %x expected, %x received, %u bytes\n " ,
4090
- pfrom->addr . ToString () ,
4089
+ LogPrint (" net" , " pong peer=%d %s: %s, %x expected, %x received, %u bytes\n " ,
4090
+ pfrom->id ,
4091
4091
pfrom->cleanSubVer ,
4092
4092
sProblem ,
4093
4093
pfrom->nPingNonceSent ,
@@ -4327,7 +4327,7 @@ bool ProcessMessages(CNode* pfrom)
4327
4327
}
4328
4328
4329
4329
if (!fRet )
4330
- LogPrintf (" ProcessMessage(%s, %u bytes) FAILED\n " , strCommand, nMessageSize);
4330
+ LogPrintf (" ProcessMessage(%s, %u bytes) FAILED peer=%d \n " , strCommand, nMessageSize, pfrom-> id );
4331
4331
4332
4332
break ;
4333
4333
}
@@ -4531,7 +4531,7 @@ bool SendMessages(CNode* pto, bool fSendTrickle)
4531
4531
uint256 hash = state.vBlocksToDownload .front ();
4532
4532
vGetData.push_back (CInv (MSG_BLOCK, hash));
4533
4533
MarkBlockAsInFlight (pto->GetId (), hash);
4534
- LogPrint (" net" , " Requesting block %s from %s \n " , hash.ToString (), state. name );
4534
+ LogPrint (" net" , " Requesting block %s peer=%d \n " , hash.ToString (), pto-> id );
4535
4535
if (vGetData.size () >= 1000 )
4536
4536
{
4537
4537
pto->PushMessage (" getdata" , vGetData);
@@ -4548,7 +4548,7 @@ bool SendMessages(CNode* pto, bool fSendTrickle)
4548
4548
if (!AlreadyHave (inv))
4549
4549
{
4550
4550
if (fDebug )
4551
- LogPrint (" net" , " sending getdata: %s \n " , inv.ToString ());
4551
+ LogPrint (" net" , " Requesting %s peer=%d \n " , inv.ToString (), pto-> id );
4552
4552
vGetData.push_back (inv);
4553
4553
if (vGetData.size () >= 1000 )
4554
4554
{
0 commit comments