@ -1233,14 +1233,14 @@ void CheckForkWarningConditions()
}
}
if ( pindexBestForkTip & & pindexBestForkBase )
if ( pindexBestForkTip & & pindexBestForkBase )
{
{
LogPrintf ( " CheckForkWarningCondition s: Warning: Large valid fork found\n forking the chain at height %d (%s) \n lasting to height %d (%s). \n Chain state database corruption likely. \n " ,
LogPrintf ( " % s: Warning: Large valid fork found\n forking the chain at height %d (%s) \n lasting to height %d (%s). \n Chain state database corruption likely. \n " , __func__ ,
pindexBestForkBase - > nHeight , pindexBestForkBase - > phashBlock - > ToString ( ) ,
pindexBestForkBase - > nHeight , pindexBestForkBase - > phashBlock - > ToString ( ) ,
pindexBestForkTip - > nHeight , pindexBestForkTip - > phashBlock - > ToString ( ) ) ;
pindexBestForkTip - > nHeight , pindexBestForkTip - > phashBlock - > ToString ( ) ) ;
fLargeWorkForkFound = true ;
fLargeWorkForkFound = true ;
}
}
else
else
{
{
LogPrintf ( " CheckForkWarningCondition s: Warning: Found invalid chain at least ~6 blocks longer than our best chain.\n Chain state database corruption likely. \n " ) ;
LogPrintf ( " % s: Warning: Found invalid chain at least ~6 blocks longer than our best chain.\n Chain state database corruption likely. \n " , __func__ ) ;
fLargeWorkInvalidChainFound = true ;
fLargeWorkInvalidChainFound = true ;
}
}
}
}
@ -1298,10 +1298,10 @@ void Misbehaving(NodeId pnode, int howmuch)
int banscore = GetArg ( " -banscore " , 100 ) ;
int banscore = GetArg ( " -banscore " , 100 ) ;
if ( state - > nMisbehavior > = banscore & & state - > nMisbehavior - howmuch < banscore )
if ( state - > nMisbehavior > = banscore & & state - > nMisbehavior - howmuch < banscore )
{
{
LogPrintf ( " Misbehaving : %s (%d -> %d) BAN THRESHOLD EXCEEDED\n " , state - > name , state - > nMisbehavior - howmuch , state - > nMisbehavior ) ;
LogPrintf ( " %s : %s (%d -> %d) BAN THRESHOLD EXCEEDED\n " , __func__ , state - > name , state - > nMisbehavior - howmuch , state - > nMisbehavior ) ;
state - > fShouldBan = true ;
state - > fShouldBan = true ;
} else
} else
LogPrintf ( " Misbehaving : %s (%d -> %d)\n " , state - > name , state - > nMisbehavior - howmuch , state - > nMisbehavior ) ;
LogPrintf ( " %s : %s (%d -> %d)\n " , __func__ , state - > name , state - > nMisbehavior - howmuch , state - > nMisbehavior ) ;
}
}
void static InvalidChainFound ( CBlockIndex * pindexNew )
void static InvalidChainFound ( CBlockIndex * pindexNew )
@ -1309,11 +1309,11 @@ void static InvalidChainFound(CBlockIndex* pindexNew)
if ( ! pindexBestInvalid | | pindexNew - > nChainWork > pindexBestInvalid - > nChainWork )
if ( ! pindexBestInvalid | | pindexNew - > nChainWork > pindexBestInvalid - > nChainWork )
pindexBestInvalid = pindexNew ;
pindexBestInvalid = pindexNew ;
LogPrintf ( " InvalidChainFound : invalid block=%s height=%d log2_work=%.8g date=%s\n " ,
LogPrintf ( " %s : invalid block=%s height=%d log2_work=%.8g date=%s\n " , __func__ ,
pindexNew - > GetBlockHash ( ) . ToString ( ) , pindexNew - > nHeight ,
pindexNew - > GetBlockHash ( ) . ToString ( ) , pindexNew - > nHeight ,
log ( pindexNew - > nChainWork . getdouble ( ) ) / log ( 2.0 ) , DateTimeStrFormat ( " %Y-%m-%d %H:%M:%S " ,
log ( pindexNew - > nChainWork . getdouble ( ) ) / log ( 2.0 ) , DateTimeStrFormat ( " %Y-%m-%d %H:%M:%S " ,
pindexNew - > GetBlockTime ( ) ) ) ;
pindexNew - > GetBlockTime ( ) ) ) ;
LogPrintf ( " InvalidChainFound : current best=%s height=%d log2_work=%.8g date=%s\n " ,
LogPrintf ( " %s : current best=%s height=%d log2_work=%.8g date=%s\n " , __func__ ,
chainActive . Tip ( ) - > GetBlockHash ( ) . ToString ( ) , chainActive . Height ( ) , log ( chainActive . Tip ( ) - > nChainWork . getdouble ( ) ) / log ( 2.0 ) ,
chainActive . Tip ( ) - > GetBlockHash ( ) . ToString ( ) , chainActive . Height ( ) , log ( chainActive . Tip ( ) - > nChainWork . getdouble ( ) ) / log ( 2.0 ) ,
DateTimeStrFormat ( " %Y-%m-%d %H:%M:%S " , chainActive . Tip ( ) - > GetBlockTime ( ) ) ) ;
DateTimeStrFormat ( " %Y-%m-%d %H:%M:%S " , chainActive . Tip ( ) - > GetBlockTime ( ) ) ) ;
CheckForkWarningConditions ( ) ;
CheckForkWarningConditions ( ) ;
@ -1921,7 +1921,7 @@ void static UpdateTip(CBlockIndex *pindexNew) {
nTimeBestReceived = GetTime ( ) ;
nTimeBestReceived = GetTime ( ) ;
mempool . AddTransactionsUpdated ( 1 ) ;
mempool . AddTransactionsUpdated ( 1 ) ;
LogPrintf ( " UpdateTip : new best=%s height=%d log2_work=%.8g tx=%lu date=%s progress=%f cache=%u\n " ,
LogPrintf ( " %s : new best=%s height=%d log2_work=%.8g tx=%lu date=%s progress=%f cache=%u\n " , __func__ ,
chainActive . Tip ( ) - > GetBlockHash ( ) . ToString ( ) , chainActive . Height ( ) , log ( chainActive . Tip ( ) - > nChainWork . getdouble ( ) ) / log ( 2.0 ) , ( unsigned long ) chainActive . Tip ( ) - > nChainTx ,
chainActive . Tip ( ) - > GetBlockHash ( ) . ToString ( ) , chainActive . Height ( ) , log ( chainActive . Tip ( ) - > nChainWork . getdouble ( ) ) / log ( 2.0 ) , ( unsigned long ) chainActive . Tip ( ) - > nChainTx ,
DateTimeStrFormat ( " %Y-%m-%d %H:%M:%S " , chainActive . Tip ( ) - > GetBlockTime ( ) ) ,
DateTimeStrFormat ( " %Y-%m-%d %H:%M:%S " , chainActive . Tip ( ) - > GetBlockTime ( ) ) ,
Checkpoints : : GuessVerificationProgress ( chainActive . Tip ( ) ) , ( unsigned int ) pcoinsTip - > GetCacheSize ( ) ) ;
Checkpoints : : GuessVerificationProgress ( chainActive . Tip ( ) ) , ( unsigned int ) pcoinsTip - > GetCacheSize ( ) ) ;
@ -1941,7 +1941,7 @@ void static UpdateTip(CBlockIndex *pindexNew) {
pindex = pindex - > pprev ;
pindex = pindex - > pprev ;
}
}
if ( nUpgraded > 0 )
if ( nUpgraded > 0 )
LogPrintf ( " SetBestChain : %d of last 100 blocks above version %d\n " , nUpgraded , ( int ) CBlock : : CURRENT_VERSION ) ;
LogPrintf ( " %s : %d of last 100 blocks above version %d\n " , __func__ , nUpgraded , ( int ) CBlock : : CURRENT_VERSION ) ;
if ( nUpgraded > 100 / 2 )
if ( nUpgraded > 100 / 2 )
{
{
// strMiscWarning is read by GetWarnings(), called by Qt and the JSON-RPC code to warn the user:
// strMiscWarning is read by GetWarnings(), called by Qt and the JSON-RPC code to warn the user:
@ -2936,7 +2936,7 @@ bool static LoadBlockIndexDB()
// Check whether we have a transaction index
// Check whether we have a transaction index
pblocktree - > ReadFlag ( " txindex " , fTxIndex ) ;
pblocktree - > ReadFlag ( " txindex " , fTxIndex ) ;
LogPrintf ( " LoadBlockIndexDB (): transaction index %s\n " , fTxIndex ? " enabled " : " disabled " ) ;
LogPrintf ( " %s (): transaction index %s\n " , __func__ , fTxIndex ? " enabled " : " disabled " ) ;
// Load pointer to end of best chain
// Load pointer to end of best chain
BlockMap : : iterator it = mapBlockIndex . find ( pcoinsTip - > GetBestBlock ( ) ) ;
BlockMap : : iterator it = mapBlockIndex . find ( pcoinsTip - > GetBestBlock ( ) ) ;
@ -2946,7 +2946,7 @@ bool static LoadBlockIndexDB()
PruneBlockIndexCandidates ( ) ;
PruneBlockIndexCandidates ( ) ;
LogPrintf ( " LoadBlockIndexDB (): hashBestChain=%s height=%d date=%s progress=%f\n " ,
LogPrintf ( " %s (): hashBestChain=%s height=%d date=%s progress=%f\n " , __func__ ,
chainActive . Tip ( ) - > GetBlockHash ( ) . ToString ( ) , chainActive . Height ( ) ,
chainActive . Tip ( ) - > GetBlockHash ( ) . ToString ( ) , chainActive . Height ( ) ,
DateTimeStrFormat ( " %Y-%m-%d %H:%M:%S " , chainActive . Tip ( ) - > GetBlockTime ( ) ) ,
DateTimeStrFormat ( " %Y-%m-%d %H:%M:%S " , chainActive . Tip ( ) - > GetBlockTime ( ) ) ,
Checkpoints : : GuessVerificationProgress ( chainActive . Tip ( ) ) ) ;
Checkpoints : : GuessVerificationProgress ( chainActive . Tip ( ) ) ) ;
@ -3492,7 +3492,7 @@ void static ProcessGetData(CNode* pfrom)
send = mi - > second - > IsValid ( BLOCK_VALID_SCRIPTS ) & & ( pindexBestHeader ! = NULL ) & &
send = mi - > second - > IsValid ( BLOCK_VALID_SCRIPTS ) & & ( pindexBestHeader ! = NULL ) & &
( mi - > second - > GetBlockTime ( ) > pindexBestHeader - > GetBlockTime ( ) - 30 * 24 * 60 * 60 ) ;
( mi - > second - > GetBlockTime ( ) > pindexBestHeader - > GetBlockTime ( ) - 30 * 24 * 60 * 60 ) ;
if ( ! send ) {
if ( ! send ) {
LogPrintf ( " ProcessGetData() : ignoring request from peer=%i for old block that isn't in the main chain\n " , pfrom - > GetId ( ) ) ;
LogPrintf ( " %s : ignoring request from peer=%i for old block that isn't in the main chain\n " , __func__ , pfrom - > GetId ( ) ) ;
}
}
}
}
}
}
@ -4394,7 +4394,7 @@ bool static ProcessMessage(CNode* pfrom, string strCommand, CDataStream& vRecv,
bool ProcessMessages ( CNode * pfrom )
bool ProcessMessages ( CNode * pfrom )
{
{
//if (fDebug)
//if (fDebug)
// LogPrintf("ProcessMessages(%u messages)\n" , pfrom->vRecvMsg.size());
// LogPrintf("%s(%u messages)\n", __func__ , pfrom->vRecvMsg.size());
//
//
// Message format
// Message format
@ -4422,7 +4422,7 @@ bool ProcessMessages(CNode* pfrom)
CNetMessage & msg = * it ;
CNetMessage & msg = * it ;
//if (fDebug)
//if (fDebug)
// LogPrintf("ProcessMessages(message %u msgsz, %u bytes, complete:%s)\n" ,
// LogPrintf("%s(message %u msgsz, %u bytes, complete:%s)\n", __func__ ,
// msg.hdr.nMessageSize, msg.vRecv.size(),
// msg.hdr.nMessageSize, msg.vRecv.size(),
// msg.complete() ? "Y" : "N");
// msg.complete() ? "Y" : "N");
@ -4458,7 +4458,7 @@ bool ProcessMessages(CNode* pfrom)
unsigned int nChecksum = ReadLE32 ( ( unsigned char * ) & hash ) ;
unsigned int nChecksum = ReadLE32 ( ( unsigned char * ) & hash ) ;
if ( nChecksum ! = hdr . nChecksum )
if ( nChecksum ! = hdr . nChecksum )
{
{
LogPrintf ( " ProcessMessage s(%s, %u bytes): CHECKSUM ERROR nChecksum=%08x hdr.nChecksum=%08x\n " ,
LogPrintf ( " % s(%s, %u bytes): CHECKSUM ERROR nChecksum=%08x hdr.nChecksum=%08x\n " , __func__ ,
SanitizeString ( strCommand ) , nMessageSize , nChecksum , hdr . nChecksum ) ;
SanitizeString ( strCommand ) , nMessageSize , nChecksum , hdr . nChecksum ) ;
continue ;
continue ;
}
}
@ -4476,12 +4476,12 @@ bool ProcessMessages(CNode* pfrom)
if ( strstr ( e . what ( ) , " end of data " ) )
if ( strstr ( e . what ( ) , " end of data " ) )
{
{
// Allow exceptions from under-length message on vRecv
// Allow exceptions from under-length message on vRecv
LogPrintf ( " ProcessMessage s(%s, %u bytes): Exception '%s' caught, normally caused by a message being shorter than its stated length\n " , SanitizeString ( strCommand ) , nMessageSize , e . what ( ) ) ;
LogPrintf ( " % s(%s, %u bytes): Exception '%s' caught, normally caused by a message being shorter than its stated length\n " , __func__ , SanitizeString ( strCommand ) , nMessageSize , e . what ( ) ) ;
}
}
else if ( strstr ( e . what ( ) , " size too large " ) )
else if ( strstr ( e . what ( ) , " size too large " ) )
{
{
// Allow exceptions from over-long size
// Allow exceptions from over-long size
LogPrintf ( " ProcessMessage s(%s, %u bytes): Exception '%s' caught\n " , SanitizeString ( strCommand ) , nMessageSize , e . what ( ) ) ;
LogPrintf ( " % s(%s, %u bytes): Exception '%s' caught\n " , __func__ , SanitizeString ( strCommand ) , nMessageSize , e . what ( ) ) ;
}
}
else
else
{
{
@ -4498,7 +4498,7 @@ bool ProcessMessages(CNode* pfrom)
}
}
if ( ! fRet )
if ( ! fRet )
LogPrintf ( " ProcessMessage (%s, %u bytes) FAILED peer=%d\n " , SanitizeString ( strCommand ) , nMessageSize , pfrom - > id ) ;
LogPrintf ( " %s (%s, %u bytes) FAILED peer=%d\n " , __func__ , SanitizeString ( strCommand ) , nMessageSize , pfrom - > id ) ;
break ;
break ;
}
}