|
|
|
@ -2221,9 +2221,9 @@ static int64_t nTimeIndex = 0;
|
|
|
|
|
static int64_t nTimeCallbacks = 0;
|
|
|
|
|
static int64_t nTimeTotal = 0;
|
|
|
|
|
|
|
|
|
|
bool ConnectBlock(const CBlock& block, CValidationState& state, CBlockIndex* pindex, CCoinsViewCache& view, bool fJustCheck)
|
|
|
|
|
bool ConnectBlock(const CBlock& block, CValidationState& state, CBlockIndex* pindex,
|
|
|
|
|
CCoinsViewCache& view, const CChainParams& chainparams, bool fJustCheck)
|
|
|
|
|
{
|
|
|
|
|
const CChainParams& chainparams = Params();
|
|
|
|
|
AssertLockHeld(cs_main);
|
|
|
|
|
|
|
|
|
|
int64_t nTimeStart = GetTimeMicros();
|
|
|
|
@ -2703,7 +2703,7 @@ bool static ConnectTip(CValidationState& state, const CChainParams& chainparams,
|
|
|
|
|
LogPrint("bench", " - Load block from disk: %.2fms [%.2fs]\n", (nTime2 - nTime1) * 0.001, nTimeReadFromDisk * 0.000001);
|
|
|
|
|
{
|
|
|
|
|
CCoinsViewCache view(pcoinsTip);
|
|
|
|
|
bool rv = ConnectBlock(*pblock, state, pindexNew, view);
|
|
|
|
|
bool rv = ConnectBlock(*pblock, state, pindexNew, view, chainparams);
|
|
|
|
|
GetMainSignals().BlockChecked(*pblock, state);
|
|
|
|
|
if (!rv) {
|
|
|
|
|
if (state.IsInvalid())
|
|
|
|
@ -3523,7 +3523,7 @@ bool TestBlockValidity(CValidationState& state, const CChainParams& chainparams,
|
|
|
|
|
return error("%s: Consensus::CheckBlock: %s", __func__, FormatStateMessage(state));
|
|
|
|
|
if (!ContextualCheckBlock(block, state, pindexPrev))
|
|
|
|
|
return error("%s: Consensus::ContextualCheckBlock: %s", __func__, FormatStateMessage(state));
|
|
|
|
|
if (!ConnectBlock(block, state, &indexDummy, viewNew, true))
|
|
|
|
|
if (!ConnectBlock(block, state, &indexDummy, viewNew, chainparams, true))
|
|
|
|
|
return false;
|
|
|
|
|
assert(state.IsValid());
|
|
|
|
|
|
|
|
|
@ -3891,7 +3891,7 @@ bool CVerifyDB::VerifyDB(const CChainParams& chainparams, CCoinsView *coinsview,
|
|
|
|
|
CBlock block;
|
|
|
|
|
if (!ReadBlockFromDisk(block, pindex, chainparams.GetConsensus()))
|
|
|
|
|
return error("VerifyDB(): *** ReadBlockFromDisk failed at %d, hash=%s", pindex->nHeight, pindex->GetBlockHash().ToString());
|
|
|
|
|
if (!ConnectBlock(block, state, pindex, coins))
|
|
|
|
|
if (!ConnectBlock(block, state, pindex, coins, chainparams))
|
|
|
|
|
return error("VerifyDB(): *** found unconnectable block at %d, hash=%s", pindex->nHeight, pindex->GetBlockHash().ToString());
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|