diff --git a/src/validation.cpp b/src/validation.cpp --- a/src/validation.cpp +++ b/src/validation.cpp @@ -1636,6 +1636,8 @@ pindex->pprev == nullptr ? BlockHash() : pindex->pprev->GetBlockHash(); assert(hashPrevBlock == view.GetBestBlock()); + nBlocksTotal++; + // Special case for the genesis block, skipping connection of its // transactions (its coinbase is unspendable) if (block.GetHash() == consensusParams.hashGenesisBlock) { @@ -1646,8 +1648,6 @@ return true; } - nBlocksTotal++; - bool fScriptChecks = true; if (!hashAssumeValid.IsNull()) { // We've been configured with the hash of a block which has been @@ -2563,6 +2563,7 @@ nTime3 = GetTimeMicros(); nTimeConnectTotal += nTime3 - nTime2; + assert(nBlocksTotal > 0); LogPrint(BCLog::BENCH, " - Connect total: %.2fms [%.2fs (%.2fms/blk)]\n", (nTime3 - nTime2) * MILLI, nTimeConnectTotal * MICRO,