@ -3547,7 +3547,7 @@ void static ProcessGetData(CNode* pfrom)
bool static ProcessMessage ( CNode * pfrom , string strCommand , CDataStream & vRecv )
bool static ProcessMessage ( CNode * pfrom , string strCommand , CDataStream & vRecv )
{
{
RandAddSeedPerfmon ( ) ;
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 )
if ( mapArgs . count ( " -dropmessagestest " ) & & GetRand ( atoi ( mapArgs [ " -dropmessagestest " ] ) ) = = 0 )
{
{
LogPrintf ( " dropmessagestest DROPPING RECV MESSAGE \n " ) ;
LogPrintf ( " dropmessagestest DROPPING RECV MESSAGE \n " ) ;
@ -3579,7 +3579,7 @@ bool static ProcessMessage(CNode* pfrom, string strCommand, CDataStream& vRecv)
if ( pfrom - > nVersion < MIN_PEER_PROTO_VERSION )
if ( pfrom - > nVersion < MIN_PEER_PROTO_VERSION )
{
{
// disconnect from peers older than this 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 ,
pfrom - > PushMessage ( " reject " , strCommand , REJECT_OBSOLETE ,
strprintf ( " Version must be %d or greater " , MIN_PEER_PROTO_VERSION ) ) ;
strprintf ( " Version must be %d or greater " , MIN_PEER_PROTO_VERSION ) ) ;
pfrom - > fDisconnect = true ;
pfrom - > fDisconnect = true ;
@ -3660,7 +3660,7 @@ bool static ProcessMessage(CNode* pfrom, string strCommand, CDataStream& vRecv)
pfrom - > fSuccessfullyConnected = true ;
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 ) ;
AddTimeData ( pfrom - > addr , nTime ) ;
}
}
@ -3767,7 +3767,7 @@ bool static ProcessMessage(CNode* pfrom, string strCommand, CDataStream& vRecv)
pfrom - > AddInventoryKnown ( inv ) ;
pfrom - > AddInventoryKnown ( inv ) ;
bool fAlreadyHave = AlreadyHave ( 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 ( ! fAlreadyHave ) {
if ( ! fImporting & & ! fReindex ) {
if ( ! fImporting & & ! fReindex ) {
@ -3800,10 +3800,10 @@ bool static ProcessMessage(CNode* pfrom, string strCommand, CDataStream& vRecv)
}
}
if ( fDebug | | ( vInv . size ( ) ! = 1 ) )
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 ) )
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 ( ) ) ;
pfrom - > vRecvGetData . insert ( pfrom - > vRecvGetData . end ( ) , vInv . begin ( ) , vInv . end ( ) ) ;
ProcessGetData ( pfrom ) ;
ProcessGetData ( pfrom ) ;
@ -3825,7 +3825,7 @@ bool static ProcessMessage(CNode* pfrom, string strCommand, CDataStream& vRecv)
if ( pindex )
if ( pindex )
pindex = chainActive . Next ( pindex ) ;
pindex = chainActive . Next ( pindex ) ;
int nLimit = 500 ;
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 ) )
for ( ; pindex ; pindex = chainActive . Next ( pindex ) )
{
{
if ( pindex - > GetBlockHash ( ) = = hashStop )
if ( pindex - > GetBlockHash ( ) = = hashStop )
@ -3908,8 +3908,8 @@ bool static ProcessMessage(CNode* pfrom, string strCommand, CDataStream& vRecv)
vEraseQueue . push_back ( inv . hash ) ;
vEraseQueue . push_back ( inv . hash ) ;
LogPrint ( " mempool " , " AcceptToMemoryPool: %s %s : accepted %s (poolsz %u) \n " ,
LogPrint ( " mempool " , " AcceptToMemoryPool: peer=%d %s : accepted %s (poolsz %u) \n " ,
pfrom - > addr . ToString ( ) , pfrom - > cleanSubVer ,
pfrom - > id , pfrom - > cleanSubVer ,
tx . GetHash ( ) . ToString ( ) ,
tx . GetHash ( ) . ToString ( ) ,
mempool . mapTx . size ( ) ) ;
mempool . mapTx . size ( ) ) ;
@ -3962,8 +3962,8 @@ bool static ProcessMessage(CNode* pfrom, string strCommand, CDataStream& vRecv)
int nDoS = 0 ;
int nDoS = 0 ;
if ( state . IsInvalid ( nDoS ) )
if ( state . IsInvalid ( nDoS ) )
{
{
LogPrint ( " mempool " , " %s from %s %s was not accepted into the memory pool: %s \n " , tx . GetHash ( ) . ToString ( ) ,
LogPrint ( " mempool " , " %s from peer=%d %s was not accepted into the memory pool: %s \n " , tx . GetHash ( ) . ToString ( ) ,
pfrom - > addr . ToString ( ) , pfrom - > cleanSubVer ,
pfrom - > id , pfrom - > cleanSubVer ,
state . GetRejectReason ( ) ) ;
state . GetRejectReason ( ) ) ;
pfrom - > PushMessage ( " reject " , strCommand , state . GetRejectCode ( ) ,
pfrom - > PushMessage ( " reject " , strCommand , state . GetRejectCode ( ) ,
state . GetRejectReason ( ) , inv . hash ) ;
state . GetRejectReason ( ) , inv . hash ) ;
@ -3978,7 +3978,7 @@ bool static ProcessMessage(CNode* pfrom, string strCommand, CDataStream& vRecv)
CBlock block ;
CBlock block ;
vRecv > > 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();
// block.print();
CInv inv ( MSG_BLOCK , block . GetHash ( ) ) ;
CInv inv ( MSG_BLOCK , block . GetHash ( ) ) ;
@ -4095,8 +4095,8 @@ bool static ProcessMessage(CNode* pfrom, string strCommand, CDataStream& vRecv)
}
}
if ( ! ( sProblem . empty ( ) ) ) {
if ( ! ( sProblem . empty ( ) ) ) {
LogPrint ( " net " , " pong %s %s: %s, %x expected, %x received, %u bytes \n " ,
LogPrint ( " net " , " pong peer=%d %s: %s, %x expected, %x received, %u bytes \n " ,
pfrom - > addr . ToString ( ) ,
pfrom - > id ,
pfrom - > cleanSubVer ,
pfrom - > cleanSubVer ,
sProblem ,
sProblem ,
pfrom - > nPingNonceSent ,
pfrom - > nPingNonceSent ,
@ -4336,7 +4336,7 @@ bool ProcessMessages(CNode* pfrom)
}
}
if ( ! fRet )
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 ;
break ;
}
}
@ -4540,7 +4540,7 @@ bool SendMessages(CNode* pto, bool fSendTrickle)
uint256 hash = state . vBlocksToDownload . front ( ) ;
uint256 hash = state . vBlocksToDownload . front ( ) ;
vGetData . push_back ( CInv ( MSG_BLOCK , hash ) ) ;
vGetData . push_back ( CInv ( MSG_BLOCK , hash ) ) ;
MarkBlockAsInFlight ( pto - > GetId ( ) , 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 )
if ( vGetData . size ( ) > = 1000 )
{
{
pto - > PushMessage ( " getdata " , vGetData ) ;
pto - > PushMessage ( " getdata " , vGetData ) ;
@ -4557,7 +4557,7 @@ bool SendMessages(CNode* pto, bool fSendTrickle)
if ( ! AlreadyHave ( inv ) )
if ( ! AlreadyHave ( inv ) )
{
{
if ( fDebug )
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 ) ;
vGetData . push_back ( inv ) ;
if ( vGetData . size ( ) > = 1000 )
if ( vGetData . size ( ) > = 1000 )
{
{