@ -308,7 +308,7 @@ bool AddOrphanTx(const CTransaction& tx)
@@ -308,7 +308,7 @@ bool AddOrphanTx(const CTransaction& tx)
BOOST_FOREACH ( const CTxIn & txin , tx . vin )
mapOrphanTransactionsByPrev [ txin . prevout . hash ] . insert ( hash ) ;
printf ( " stored orphan tx %s (mapsz % " PRIszu " ) \n " , hash . ToString ( ) . c_str ( ) ,
printf ( " stored orphan tx %s (mapsz % " PRIszu " ) \n " , hash . ToString ( ) . c_str ( ) ,
mapOrphanTransactions . size ( ) ) ;
return true ;
}
@ -759,7 +759,7 @@ bool CTxMemPool::accept(CValidationState &state, CTransaction &tx, bool fCheckIn
@@ -759,7 +759,7 @@ bool CTxMemPool::accept(CValidationState &state, CTransaction &tx, bool fCheckIn
// Don't accept it if it can't get into a block
int64 txMinFee = tx . GetMinFee ( 1000 , true , GMF_RELAY ) ;
if ( fLimitFree & & nFees < txMinFee )
return error ( " CTxMemPool::accept() : not enough fees %s, % " PRI64d " < % " PRI64d ,
return error ( " CTxMemPool::accept() : not enough fees %s, % " PRI64d " < % " PRI64d ,
hash . ToString ( ) . c_str ( ) ,
nFees , txMinFee ) ;
@ -1247,7 +1247,7 @@ unsigned int static OldGetNextWorkRequired(const CBlockIndex* pindexLast, const
@@ -1247,7 +1247,7 @@ unsigned int static OldGetNextWorkRequired(const CBlockIndex* pindexLast, const
int64 nActualTimespanMax = fNewDifficultyProtocol ? ( nTargetTimespanCurrent * 4 ) : ( ( nTargetTimespanCurrent * 99 ) / 70 ) ;
int64 nActualTimespanMin = fNewDifficultyProtocol ? ( nTargetTimespanCurrent / 4 ) : ( ( nTargetTimespanCurrent * 70 ) / 99 ) ;
# ifdef __DEBUG
printf ( " nActualTimespan = % " PRI64d " before bounds \n " , nActualTimespan ) ;
printf ( " nActualTimespan = % " PRI64d " before bounds \n " , nActualTimespan ) ;
# endif
if ( pindexLast - > nHeight + 1 > = nDifficultySwitchHeight2 ) {
if ( nActualTimespan < nActualTimespanMin )
@ -1282,7 +1282,7 @@ unsigned int static OldGetNextWorkRequired(const CBlockIndex* pindexLast, const
@@ -1282,7 +1282,7 @@ unsigned int static OldGetNextWorkRequired(const CBlockIndex* pindexLast, const
/// debug print
# ifdef __DEBUG
printf ( " OldGetNextWorkRequired RETARGET \n " ) ;
printf ( " nTargetTimespan = % " PRI64d " nActualTimespan = % " PRI64d " \n " , nTargetTimespan , nActualTimespan ) ;
printf ( " nTargetTimespan = % " PRI64d " nActualTimespan = % " PRI64d " \n " , nTargetTimespan , nActualTimespan ) ;
printf ( " Before: %08x %s \n " , pindexLast - > nBits , CBigNum ( ) . SetCompact ( pindexLast - > nBits ) . getuint256 ( ) . ToString ( ) . c_str ( ) ) ;
printf ( " After: %08x %s \n " , bnNew . GetCompact ( ) , bnNew . getuint256 ( ) . ToString ( ) . c_str ( ) ) ;
# endif
@ -1844,7 +1844,7 @@ bool CBlock::ConnectBlock(CValidationState &state, CBlockIndex* pindex, CCoinsVi
@@ -1844,7 +1844,7 @@ bool CBlock::ConnectBlock(CValidationState &state, CBlockIndex* pindex, CCoinsVi
printf ( " - Connect %u transactions: %.2fms (%.3fms/tx, %.3fms/txin) \n " , ( unsigned ) vtx . size ( ) , 0.001 * nTime , 0.001 * nTime / vtx . size ( ) , nInputs < = 1 ? 0 : 0.001 * nTime / ( nInputs - 1 ) ) ;
if ( vtx [ 0 ] . GetValueOut ( ) > GetBlockValue ( pindex - > nHeight , nFees ) )
return state . DoS ( 100 , error ( " ConnectBlock() : coinbase pays too much (actual=% " PRI64d " vs limit=% " PRI64d " ) " , vtx [ 0 ] . GetValueOut ( ) , GetBlockValue ( pindex - > nHeight , nFees ) ) ) ;
return state . DoS ( 100 , error ( " ConnectBlock() : coinbase pays too much (actual=% " PRI64d " vs limit=% " PRI64d " ) " , vtx [ 0 ] . GetValueOut ( ) , GetBlockValue ( pindex - > nHeight , nFees ) ) ) ;
if ( ! control . Wait ( ) )
return state . DoS ( 100 , false ) ;
@ -1924,8 +1924,8 @@ bool SetBestChain(CValidationState &state, CBlockIndex* pindexNew)
@@ -1924,8 +1924,8 @@ bool SetBestChain(CValidationState &state, CBlockIndex* pindexNew)
reverse ( vConnect . begin ( ) , vConnect . end ( ) ) ;
if ( vDisconnect . size ( ) > 0 ) {
printf ( " REORGANIZE: Disconnect % " PRIszu " blocks; %s.. \n " , vDisconnect . size ( ) , pfork - > GetBlockHash ( ) . ToString ( ) . c_str ( ) ) ;
printf ( " REORGANIZE: Connect % " PRIszu " blocks; ..%s \n " , vConnect . size ( ) , pindexNew - > GetBlockHash ( ) . ToString ( ) . c_str ( ) ) ;
printf ( " REORGANIZE: Disconnect % " PRIszu " blocks; %s.. \n " , vDisconnect . size ( ) , pfork - > GetBlockHash ( ) . ToString ( ) . c_str ( ) ) ;
printf ( " REORGANIZE: Connect % " PRIszu " blocks; ..%s \n " , vConnect . size ( ) , pindexNew - > GetBlockHash ( ) . ToString ( ) . c_str ( ) ) ;
}
// Disconnect shorter branch
@ -3024,7 +3024,7 @@ void PrintBlockTree()
@@ -3024,7 +3024,7 @@ void PrintBlockTree()
// print item
CBlock block ;
block . ReadFromDisk ( pindex ) ;
printf ( " %d (blk%05u.dat:0x%x) %s tx % " PRIszu " " ,
printf ( " %d (blk%05u.dat:0x%x) %s tx % " PRIszu " " ,
pindex - > nHeight ,
pindex - > GetBlockPos ( ) . nFile , pindex - > GetBlockPos ( ) . nPos ,
DateTimeStrFormat ( " %Y-%m-%d %H:%M:%S " , block . GetBlockTime ( ) ) . c_str ( ) ,
@ -3117,7 +3117,7 @@ bool LoadExternalBlockFile(FILE* fileIn, CDiskBlockPos *dbp)
@@ -3117,7 +3117,7 @@ bool LoadExternalBlockFile(FILE* fileIn, CDiskBlockPos *dbp)
AbortNode ( _ ( " Error: system error: " ) + e . what ( ) ) ;
}
if ( nLoaded > 0 )
printf ( " Loaded %i blocks from external file in % " PRI64d " ms \n " , nLoaded , GetTimeMillis ( ) - nStart ) ;
printf ( " Loaded %i blocks from external file in % " PRI64d " ms \n " , nLoaded , GetTimeMillis ( ) - nStart ) ;
return nLoaded > 0 ;
}
@ -3369,7 +3369,7 @@ bool static ProcessMessage(CNode* pfrom, string strCommand, CDataStream& vRecv)
@@ -3369,7 +3369,7 @@ bool static ProcessMessage(CNode* pfrom, string strCommand, CDataStream& vRecv)
{
RandAddSeedPerfmon ( ) ;
if ( fDebug )
printf ( " received: %s (% " PRIszu " bytes) \n " , strCommand . c_str ( ) , vRecv . size ( ) ) ;
printf ( " received: %s (% " PRIszu " bytes) \n " , strCommand . c_str ( ) , vRecv . size ( ) ) ;
if ( mapArgs . count ( " -dropmessagestest " ) & & GetRand ( atoi ( mapArgs [ " -dropmessagestest " ] ) ) = = 0 )
{
printf ( " dropmessagestest DROPPING RECV MESSAGE \n " ) ;
@ -3515,7 +3515,7 @@ bool static ProcessMessage(CNode* pfrom, string strCommand, CDataStream& vRecv)
@@ -3515,7 +3515,7 @@ bool static ProcessMessage(CNode* pfrom, string strCommand, CDataStream& vRecv)
if ( vAddr . size ( ) > 1000 )
{
pfrom - > Misbehaving ( 20 ) ;
return error ( " message addr size() = % " PRIszu " " , vAddr.size()) ;
return error ( " message addr size() = % " PRIszu " " , vAddr.size()) ;
}
// Store the new addresses
@ -3578,7 +3578,7 @@ bool static ProcessMessage(CNode* pfrom, string strCommand, CDataStream& vRecv)
@@ -3578,7 +3578,7 @@ bool static ProcessMessage(CNode* pfrom, string strCommand, CDataStream& vRecv)
if ( vInv . size ( ) > MAX_INV_SZ )
{
pfrom - > Misbehaving ( 20 ) ;
return error ( " message inv size() = % " PRIszu " " , vInv.size()) ;
return error ( " message inv size() = % " PRIszu " " , vInv.size()) ;
}
// find last block in inv vector
@ -3627,11 +3627,11 @@ bool static ProcessMessage(CNode* pfrom, string strCommand, CDataStream& vRecv)
@@ -3627,11 +3627,11 @@ bool static ProcessMessage(CNode* pfrom, string strCommand, CDataStream& vRecv)
if ( vInv . size ( ) > MAX_INV_SZ )
{
pfrom - > Misbehaving ( 20 ) ;
return error ( " message getdata size() = % " PRIszu " " , vInv.size()) ;
return error ( " message getdata size() = % " PRIszu " " , vInv.size()) ;
}
if ( fDebugNet | | ( vInv . size ( ) ! = 1 ) )
printf ( " received getdata (% " PRIszu " invsz) \n " , vInv . size ( ) ) ;
printf ( " received getdata (% " PRIszu " invsz) \n " , vInv . size ( ) ) ;
if ( ( fDebugNet & & vInv . size ( ) > 0 ) | | ( vInv . size ( ) = = 1 ) )
printf ( " received getdata for: %s \n " , vInv [ 0 ] . ToString ( ) . c_str ( ) ) ;
@ -3732,7 +3732,7 @@ bool static ProcessMessage(CNode* pfrom, string strCommand, CDataStream& vRecv)
@@ -3732,7 +3732,7 @@ bool static ProcessMessage(CNode* pfrom, string strCommand, CDataStream& vRecv)
vWorkQueue . push_back ( inv . hash ) ;
vEraseQueue . push_back ( inv . hash ) ;
printf ( " AcceptToMemoryPool: %s %s : accepted %s (poolsz % " PRIszu " ) \n " ,
printf ( " AcceptToMemoryPool: %s %s : accepted %s (poolsz % " PRIszu " ) \n " ,
pfrom - > addr . ToString ( ) . c_str ( ) , pfrom - > strSubVer . c_str ( ) ,
tx . GetHash ( ) . ToString ( ) . c_str ( ) ,
mempool . mapTx . size ( ) ) ;
@ -4581,7 +4581,7 @@ CBlockTemplate* CreateNewBlock(const CScript& scriptPubKeyIn)
@@ -4581,7 +4581,7 @@ CBlockTemplate* CreateNewBlock(const CScript& scriptPubKeyIn)
nLastBlockTx = nBlockTx ;
nLastBlockSize = nBlockSize ;
printf ( " CreateNewBlock(): total size % " PRI64u " \n " , nBlockSize ) ;
printf ( " CreateNewBlock(): total size % " PRI64u " \n " , nBlockSize ) ;
pblock - > vtx [ 0 ] . vout [ 0 ] . nValue = GetBlockValue ( pindexPrev - > nHeight + 1 , nFees ) ;
pblocktemplate - > vTxFees [ 0 ] = - nFees ;
@ -4745,7 +4745,7 @@ void static GostcoinMiner(CWallet *pwallet)
@@ -4745,7 +4745,7 @@ void static GostcoinMiner(CWallet *pwallet)
CBlock * pblock = & pblocktemplate - > block ;
IncrementExtraNonce ( pblock , pindexPrev , nExtraNonce ) ;
printf ( " Running GostcoinMiner with % " PRIszu " transactions in block (%u bytes) \n " , pblock - > vtx . size ( ) ,
printf ( " Running GostcoinMiner with % " PRIszu " transactions in block (%u bytes) \n " , pblock - > vtx . size ( ) ,
: : GetSerializeSize ( * pblock , SER_NETWORK , PROTOCOL_VERSION ) ) ;
//