Revert "Test"

This reverts commit f56990f6f7.
This commit is contained in:
jl777
2018-04-15 23:31:01 +03:00
parent 397094b904
commit dbd87e657c

View File

@@ -3022,11 +3022,7 @@ CBlockIndex* AddToBlockIndex(const CBlockHeader& block)
uint256 hash = block.GetHash(); uint256 hash = block.GetHash();
BlockMap::iterator it = mapBlockIndex.find(hash); BlockMap::iterator it = mapBlockIndex.find(hash);
if (it != mapBlockIndex.end()) if (it != mapBlockIndex.end())
{
if ( it->second != 0 )
return it->second; return it->second;
else fprintf(stderr,"AddToBlockIndex unexpected null it->second\n");
}
// Construct new block index object // Construct new block index object
CBlockIndex* pindexNew = new CBlockIndex(block); CBlockIndex* pindexNew = new CBlockIndex(block);
@@ -3331,7 +3327,7 @@ bool ContextualCheckBlockHeader(const CBlockHeader& block, CValidationState& sta
CBlockIndex *heightblock = chainActive[nHeight]; CBlockIndex *heightblock = chainActive[nHeight];
if ( heightblock != 0 && heightblock->GetBlockHash() == hash ) if ( heightblock != 0 && heightblock->GetBlockHash() == hash )
{ {
//fprintf(stderr,"got a pre notarization block that matches height.%d\n",(int32_t)nHeight); fprintf(stderr,"got a pre notarization block that matches height.%d\n",(int32_t)nHeight);
return true; return true;
} return state.DoS(100, error("%s: rejected by checkpoint lock-in at %d", __func__, nHeight),REJECT_CHECKPOINT, "checkpoint mismatch"); } return state.DoS(100, error("%s: rejected by checkpoint lock-in at %d", __func__, nHeight),REJECT_CHECKPOINT, "checkpoint mismatch");
} }
@@ -3439,7 +3435,6 @@ bool AcceptBlockHeader(const CBlockHeader& block, CValidationState& state, CBloc
return false; return false;
} }
} }
fprintf(stderr,"return true pindex.%p %ppindex.%p\n",pindex,*ppindex);
return true; return true;
} }
@@ -3465,10 +3460,7 @@ bool AcceptBlockHeader(const CBlockHeader& block, CValidationState& state, CBloc
return false; return false;
} }
if (pindex == NULL) if (pindex == NULL)
{ pindex = AddToBlockIndex(block);
if ( (pindex= AddToBlockIndex(block)) == 0 )
fprintf(stderr,"AcceptBlockHeader couldnt create pindex\n");
}
if (ppindex) if (ppindex)
*ppindex = pindex; *ppindex = pindex;
return true; return true;