@ -3538,7 +3538,7 @@ void static ProcessGetData(CNode* pfrom)
@@ -3538,7 +3538,7 @@ void static ProcessGetData(CNode* pfrom)
bool static ProcessMessage ( CNode * pfrom , string strCommand , CDataStream & vRecv )
{
RandAddSeedPerfmon ( ) ;
LogPrint ( " net " , " received: %s (%u bytes) \n " , strCommand , vRecv . size ( ) ) ;
LogPrint ( " net " , " received: %s (%u bytes) peer=%d \n " , strCommand , vRecv . size ( ) , pfrom - > id ) ;
if ( mapArgs . count ( " -dropmessagestest " ) & & GetRand ( atoi ( mapArgs [ " -dropmessagestest " ] ) ) = = 0 )
{
LogPrintf ( " dropmessagestest DROPPING RECV MESSAGE \n " ) ;
@ -3570,7 +3570,7 @@ bool static ProcessMessage(CNode* pfrom, string strCommand, CDataStream& vRecv)
@@ -3570,7 +3570,7 @@ bool static ProcessMessage(CNode* pfrom, string strCommand, CDataStream& vRecv)
if ( pfrom - > nVersion < MIN_PEER_PROTO_VERSION )
{
// disconnect from peers older than this proto version
LogPrintf ( " partner %s using obsolete version %i; disconnecting \n " , pfrom - > addr . ToString ( ) , pfrom - > nVersion ) ;
LogPrintf ( " peer=%d using obsolete version %i; disconnecting \n " , pfrom - > id , pfrom - > nVersion ) ;
pfrom - > PushMessage ( " reject " , strCommand , REJECT_OBSOLETE ,
strprintf ( " Version must be %d or greater " , MIN_PEER_PROTO_VERSION ) ) ;
pfrom - > fDisconnect = true ;
@ -3651,7 +3651,7 @@ bool static ProcessMessage(CNode* pfrom, string strCommand, CDataStream& vRecv)
@@ -3651,7 +3651,7 @@ bool static ProcessMessage(CNode* pfrom, string strCommand, CDataStream& vRecv)
pfrom - > fSuccessfullyConnected = true ;
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 ( ) ) ;
LogPrintf ( " receive version message: %s: version %d, blocks=%d, us=%s, peer=%d \n " , pfrom - > cleanSubVer , pfrom - > nVersion , pfrom - > nStartingHeight , addrMe . ToString ( ) , pfrom - > id ) ;
AddTimeData ( pfrom - > addr , nTime ) ;
}
@ -3758,7 +3758,7 @@ bool static ProcessMessage(CNode* pfrom, string strCommand, CDataStream& vRecv)
@@ -3758,7 +3758,7 @@ bool static ProcessMessage(CNode* pfrom, string strCommand, CDataStream& vRecv)
pfrom - > AddInventoryKnown ( inv ) ;
bool fAlreadyHave = AlreadyHave ( inv ) ;
LogPrint ( " net " , " got inventory : %s %s\n " , inv . ToString ( ) , fAlreadyHave ? " have " : " new " ) ;
LogPrint ( " net " , " got inv: %s %s peer=%d \n " , inv . ToString ( ) , fAlreadyHave ? " have " : " new " , pfrom - > id ) ;
if ( ! fAlreadyHave ) {
if ( ! fImporting & & ! fReindex ) {
@ -3791,10 +3791,10 @@ bool static ProcessMessage(CNode* pfrom, string strCommand, CDataStream& vRecv)
@@ -3791,10 +3791,10 @@ bool static ProcessMessage(CNode* pfrom, string strCommand, CDataStream& vRecv)
}
if ( fDebug | | ( vInv . size ( ) ! = 1 ) )
LogPrint ( " net " , " received getdata (%u invsz) \n " , vInv . size ( ) ) ;
LogPrint ( " net " , " received getdata (%u invsz) peer=%d \n " , vInv . size ( ) , pfrom - > id ) ;
if ( ( fDebug & & vInv . size ( ) > 0 ) | | ( vInv . size ( ) = = 1 ) )
LogPrint ( " net " , " received getdata for: %s \n " , vInv [ 0 ] . ToString ( ) ) ;
LogPrint ( " net " , " received getdata for: %s peer=%d \n " , vInv [ 0 ] . ToString ( ) , pfrom - > id ) ;
pfrom - > vRecvGetData . insert ( pfrom - > vRecvGetData . end ( ) , vInv . begin ( ) , vInv . end ( ) ) ;
ProcessGetData ( pfrom ) ;
@ -3816,7 +3816,7 @@ bool static ProcessMessage(CNode* pfrom, string strCommand, CDataStream& vRecv)
@@ -3816,7 +3816,7 @@ bool static ProcessMessage(CNode* pfrom, string strCommand, CDataStream& vRecv)
if ( pindex )
pindex = chainActive . Next ( pindex ) ;
int nLimit = 500 ;
LogPrint ( " net " , " getblocks %d to %s limit %d \n " , ( pindex ? pindex - > nHeight : - 1 ) , hashStop = = uint256 ( 0 ) ? " end " : hashStop . ToString ( ) , nLimit ) ;
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 ) ;
for ( ; pindex ; pindex = chainActive . Next ( pindex ) )
{
if ( pindex - > GetBlockHash ( ) = = hashStop )
@ -3899,8 +3899,8 @@ bool static ProcessMessage(CNode* pfrom, string strCommand, CDataStream& vRecv)
@@ -3899,8 +3899,8 @@ bool static ProcessMessage(CNode* pfrom, string strCommand, CDataStream& vRecv)
vEraseQueue . push_back ( inv . hash ) ;
LogPrint ( " mempool " , " AcceptToMemoryPool: %s %s : accepted %s (poolsz %u) \n " ,
pfrom - > addr . ToString ( ) , pfrom - > cleanSubVer ,
LogPrint ( " mempool " , " AcceptToMemoryPool: peer=%d %s : accepted %s (poolsz %u) \n " ,
pfrom - > id , pfrom - > cleanSubVer ,
tx . GetHash ( ) . ToString ( ) ,
mempool . mapTx . size ( ) ) ;
@ -3953,8 +3953,8 @@ bool static ProcessMessage(CNode* pfrom, string strCommand, CDataStream& vRecv)
@@ -3953,8 +3953,8 @@ bool static ProcessMessage(CNode* pfrom, string strCommand, CDataStream& vRecv)
int nDoS = 0 ;
if ( state . IsInvalid ( nDoS ) )
{
LogPrint ( " mempool " , " %s from %s %s was not accepted into the memory pool: %s \n " , tx . GetHash ( ) . ToString ( ) ,
pfrom - > addr . ToString ( ) , pfrom - > cleanSubVer ,
LogPrint ( " mempool " , " %s from peer=%d %s was not accepted into the memory pool: %s \n " , tx . GetHash ( ) . ToString ( ) ,
pfrom - > id , pfrom - > cleanSubVer ,
state . GetRejectReason ( ) ) ;
pfrom - > PushMessage ( " reject " , strCommand , state . GetRejectCode ( ) ,
state . GetRejectReason ( ) , inv . hash ) ;
@ -3969,7 +3969,7 @@ bool static ProcessMessage(CNode* pfrom, string strCommand, CDataStream& vRecv)
@@ -3969,7 +3969,7 @@ bool static ProcessMessage(CNode* pfrom, string strCommand, CDataStream& vRecv)
CBlock block ;
vRecv > > block ;
LogPrint ( " net " , " received block %s \n " , block . GetHash ( ) . ToString ( ) ) ;
LogPrint ( " net " , " received block %s peer=%d \n " , block . GetHash ( ) . ToString ( ) , pfrom - > id ) ;
// block.print();
CInv inv ( MSG_BLOCK , block . GetHash ( ) ) ;
@ -4086,8 +4086,8 @@ bool static ProcessMessage(CNode* pfrom, string strCommand, CDataStream& vRecv)
@@ -4086,8 +4086,8 @@ bool static ProcessMessage(CNode* pfrom, string strCommand, CDataStream& vRecv)
}
if ( ! ( sProblem . empty ( ) ) ) {
LogPrint ( " net " , " pong %s %s: %s, %x expected, %x received, %u bytes \n " ,
pfrom - > addr . ToString ( ) ,
LogPrint ( " net " , " pong peer=%d %s: %s, %x expected, %x received, %u bytes \n " ,
pfrom - > id ,
pfrom - > cleanSubVer ,
sProblem ,
pfrom - > nPingNonceSent ,
@ -4327,7 +4327,7 @@ bool ProcessMessages(CNode* pfrom)
@@ -4327,7 +4327,7 @@ bool ProcessMessages(CNode* pfrom)
}
if ( ! fRet )
LogPrintf ( " ProcessMessage(%s, %u bytes) FAILED \n " , strCommand , nMessageSize ) ;
LogPrintf ( " ProcessMessage(%s, %u bytes) FAILED peer=%d \n " , strCommand , nMessageSize , pfrom - > id ) ;
break ;
}
@ -4531,7 +4531,7 @@ bool SendMessages(CNode* pto, bool fSendTrickle)
@@ -4531,7 +4531,7 @@ bool SendMessages(CNode* pto, bool fSendTrickle)
uint256 hash = state . vBlocksToDownload . front ( ) ;
vGetData . push_back ( CInv ( MSG_BLOCK , hash ) ) ;
MarkBlockAsInFlight ( pto - > GetId ( ) , hash ) ;
LogPrint ( " net " , " Requesting block %s from %s \n " , hash . ToString ( ) , state . name ) ;
LogPrint ( " net " , " Requesting block %s peer=%d \n " , hash . ToString ( ) , pto - > id ) ;
if ( vGetData . size ( ) > = 1000 )
{
pto - > PushMessage ( " getdata " , vGetData ) ;
@ -4548,7 +4548,7 @@ bool SendMessages(CNode* pto, bool fSendTrickle)
@@ -4548,7 +4548,7 @@ bool SendMessages(CNode* pto, bool fSendTrickle)
if ( ! AlreadyHave ( inv ) )
{
if ( fDebug )
LogPrint ( " net " , " sending getdata: %s \n " , inv . ToString ( ) ) ;
LogPrint ( " net " , " Requesting %s peer=%d \n " , inv . ToString ( ) , pto - > id ) ;
vGetData . push_back ( inv ) ;
if ( vGetData . size ( ) > = 1000 )
{