diff --git a/src/main.cpp b/src/main.cpp index 307d1d460..0c03f4f40 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -3448,13 +3448,25 @@ bool TestBlockValidity(CValidationState &state, const CBlock& block, CBlockIndex // NOTE: CheckBlockHeader is called by CheckBlock if (!ContextualCheckBlockHeader(block, state, pindexPrev)) + { + fprintf(stderr,"TestBlockValidity failure A\n"); return false; + } if (!CheckBlock(indexDummy.nHeight,0,block, state, verifier, fCheckPOW, fCheckMerkleRoot)) + { + fprintf(stderr,"TestBlockValidity failure B\n"); return false; + } if (!ContextualCheckBlock(block, state, pindexPrev)) + { + fprintf(stderr,"TestBlockValidity failure C\n"); return false; + } if (!ConnectBlock(block, state, &indexDummy, viewNew, true)) + { + fprintf(stderr,"TestBlockValidity failure D\n"); return false; + } assert(state.IsValid()); return true; diff --git a/src/miner.cpp b/src/miner.cpp index c3e14b343..597b5e400 100644 --- a/src/miner.cpp +++ b/src/miner.cpp @@ -426,7 +426,9 @@ CBlockTemplate* CreateNewBlock(const CScript& scriptPubKeyIn) CValidationState state; if ( !TestBlockValidity(state, *pblock, pindexPrev, false, false)) { - fprintf(stderr,"warning: testblockvalidity failed\n"); + static uint32_t counter; + if ( counter++ < 100 ) + fprintf(stderr,"warning: testblockvalidity failed\n"); return(0); //throw std::runtime_error("CreateNewBlock(): TestBlockValidity failed"); } @@ -615,7 +617,7 @@ void static BitcoinMiner(CWallet *pwallet) CBlockTemplate *ptr = CreateNewBlockWithKey(reservekey); if ( ptr == 0 ) { - static int32_t counter; + static uint32_t counter; if ( counter++ < 100 ) fprintf(stderr,"created illegal block, retry\n"); continue;