From ab714a45d036b836f193e151a6c297541678e0c5 Mon Sep 17 00:00:00 2001 From: jl777 Date: Mon, 17 Oct 2016 16:05:20 -0300 Subject: [PATCH] test --- src/main.cpp | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/src/main.cpp b/src/main.cpp index 89470573e..14cffc68e 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -2946,14 +2946,12 @@ bool FindUndoPos(CValidationState &state, int nFile, CDiskBlockPos &pos, unsigne bool CheckBlockHeader(const CBlockHeader& block, CValidationState& state, bool fCheckPOW) { - int32_t retval; uint32_t nBits; + int32_t retval; uint32_t nBits; CBlockIndex *bindex = new CBlockIndex(block); // Check timestamp if (block.GetBlockTime() > GetAdjustedTime() + 60) return state.Invalid(error("CheckBlockHeader(): block timestamp too far in the future"),REJECT_INVALID, "time-too-new"); nBits = block.nBits; - CBlockIndex *bindex = new CBlockIndex(block); - - if ( bindex->nHeight < NOTARIZED_HEIGHT || (bindex->nHeight == NOTARIZED_HEIGHT && NOTARIZED_HASH != bindex->GetBlockHash()) ) + if ( bindex != 0 && (bindex->nHeight < NOTARIZED_HEIGHT || (bindex->nHeight == NOTARIZED_HEIGHT && NOTARIZED_HASH != bindex->GetBlockHash())) ) return(false); if ( (retval= komodo_blockhdrcheck(&block,&nBits)) == 0 ) {