This commit is contained in:
jl777
2019-03-02 01:54:50 -11:00
parent 93ba595a83
commit 4a8df61a7b

View File

@@ -3634,10 +3634,11 @@ bool ConnectBlock(const CBlock& block, CValidationState& state, CBlockIndex* pin
return true;
// Write undo information to disk
fprintf(stderr,"isNull %d vs isvalid %d nStatus %x\n",pindex->GetUndoPos().IsNull(),pindex->IsValid(BLOCK_VALID_SCRIPTS),(uint32_t)pindex->nStatus);
fprintf(stderr,"nFile.%d isNull %d vs isvalid %d nStatus %x\n",(int32_t)pindex->nFile,pindex->GetUndoPos().IsNull(),pindex->IsValid(BLOCK_VALID_SCRIPTS),(uint32_t)pindex->nStatus);
if (pindex->GetUndoPos().IsNull() || !pindex->IsValid(BLOCK_VALID_SCRIPTS))
{
if (pindex->GetUndoPos().IsNull()) {
if (pindex->GetUndoPos().IsNull())
{
CDiskBlockPos pos;
if (!FindUndoPos(state, pindex->nFile, pos, ::GetSerializeSize(blockundo, SER_DISK, CLIENT_VERSION) + 40))
return error("ConnectBlock(): FindUndoPos failed");
@@ -3649,7 +3650,7 @@ bool ConnectBlock(const CBlock& block, CValidationState& state, CBlockIndex* pin
pindex->nUndoPos = pos.nPos;
pindex->nStatus |= BLOCK_HAVE_UNDO;
}
// Now that all consensus rules have been validated, set nCachedBranchId.
// Move this if BLOCK_VALID_CONSENSUS is ever altered.
static_assert(BLOCK_VALID_CONSENSUS == BLOCK_VALID_SCRIPTS,
@@ -3660,7 +3661,7 @@ bool ConnectBlock(const CBlock& block, CValidationState& state, CBlockIndex* pin
} else if (pindex->pprev) {
pindex->nCachedBranchId = pindex->pprev->nCachedBranchId;
}
pindex->RaiseValidity(BLOCK_VALID_SCRIPTS);
setDirtyBlockIndex.insert(pindex);
}