Better error message when hashPrevBlock != view.GetBestBlock

This commit is contained in:
Duke
2023-06-13 22:58:36 -04:00
parent 31d97c7c9c
commit 13612bb1c8

View File

@@ -3243,7 +3243,8 @@ bool ConnectBlock(const CBlock& block, CValidationState& state, CBlockIndex* pin
uint256 hashPrevBlock = pindex->pprev == NULL ? uint256() : pindex->pprev->GetBlockHash();
if ( hashPrevBlock != view.GetBestBlock() )
{
fprintf(stderr,"ConnectBlock(): hashPrevBlock != view.GetBestBlock()\n");
fprintf(stderr,"ConnectBlock(): hashPrevBlock != view.GetBestBlock() %s != %s\n", hashPrevBlock.ToString().c_str(), view.GetBestBlock().ToString().c_str() );
return state.DoS(1, error("ConnectBlock(): hashPrevBlock != view.GetBestBlock()"),
REJECT_INVALID, "hashPrevBlock-not-bestblock");
}