diff --git a/src/bench/duplicate_inputs.cpp b/src/bench/duplicate_inputs.cpp --- a/src/bench/duplicate_inputs.cpp +++ b/src/bench/duplicate_inputs.cpp @@ -35,8 +35,6 @@ CMutableTransaction naughtyTx{}; LOCK(cs_main); - assert(std::addressof(::ChainActive()) == - std::addressof(test_setup.m_node.chainman->ActiveChain())); CBlockIndex *pindexPrev = test_setup.m_node.chainman->ActiveChain().Tip(); assert(pindexPrev != nullptr); block.nBits = GetNextWorkRequired(pindexPrev, &block, chainParams); diff --git a/src/index/base.cpp b/src/index/base.cpp --- a/src/index/base.cpp +++ b/src/index/base.cpp @@ -363,8 +363,6 @@ } void BaseIndex::Start(CChainState &active_chainstate) { - assert(std::addressof(::ChainstateActive()) == - std::addressof(active_chainstate)); m_chainstate = &active_chainstate; // Need to register this ValidationInterface before running Init(), so that // callbacks are not missed if Init sets m_synced to true. diff --git a/src/init.cpp b/src/init.cpp --- a/src/init.cpp +++ b/src/init.cpp @@ -2704,8 +2704,6 @@ // If the loaded chain has a wrong genesis, bail out immediately // (we're likely using a testnet datadir, or the other way // around). - assert(std::addressof(g_chainman.m_blockman) == - std::addressof(chainman.m_blockman)); if (!chainman.BlockIndex().empty() && !chainman.m_blockman.LookupBlockIndex( params.hashGenesisBlock)) { @@ -2945,8 +2943,6 @@ // fHaveGenesis directly. // No locking, as this happens before any background thread is started. boost::signals2::connection block_notify_genesis_wait_connection; - assert(std::addressof(::ChainActive()) == - std::addressof(chainman.ActiveChain())); if (chainman.ActiveTip() == nullptr) { block_notify_genesis_wait_connection = uiInterface.NotifyBlockTip_connect( diff --git a/src/interfaces/chain.cpp b/src/interfaces/chain.cpp --- a/src/interfaces/chain.cpp +++ b/src/interfaces/chain.cpp @@ -217,8 +217,6 @@ findLocatorFork(const CBlockLocator &locator) override { LOCK(cs_main); const CChain &active = Assert(m_node.chainman)->ActiveChain(); - assert(std::addressof(g_chainman) == - std::addressof(*m_node.chainman)); if (CBlockIndex *fork = m_node.chainman->m_blockman.FindForkInGlobalIndex( active, locator)) { @@ -230,8 +228,6 @@ const FoundBlock &block) override { WAIT_LOCK(cs_main, lock); const CChain &active = Assert(m_node.chainman)->ActiveChain(); - assert(std::addressof(g_chainman) == - std::addressof(*m_node.chainman)); return FillBlock(m_node.chainman->m_blockman.LookupBlockIndex(hash), block, lock, active); } @@ -248,8 +244,6 @@ const FoundBlock &ancestor_out) override { WAIT_LOCK(cs_main, lock); const CChain &active = Assert(m_node.chainman)->ActiveChain(); - assert(std::addressof(g_chainman) == - std::addressof(*m_node.chainman)); if (const CBlockIndex *block = m_node.chainman->m_blockman.LookupBlockIndex(block_hash)) { if (const CBlockIndex *ancestor = @@ -264,8 +258,6 @@ const FoundBlock &ancestor_out) override { WAIT_LOCK(cs_main, lock); const CChain &active = Assert(m_node.chainman)->ActiveChain(); - assert(std::addressof(g_chainman) == - std::addressof(*m_node.chainman)); const CBlockIndex *block = m_node.chainman->m_blockman.LookupBlockIndex(block_hash); const CBlockIndex *ancestor = @@ -283,8 +275,6 @@ const FoundBlock &block2_out) override { WAIT_LOCK(cs_main, lock); const CChain &active = Assert(m_node.chainman)->ActiveChain(); - assert(std::addressof(g_chainman) == - std::addressof(*m_node.chainman)); const CBlockIndex *block1 = m_node.chainman->m_blockman.LookupBlockIndex(block_hash1); const CBlockIndex *block2 = @@ -303,8 +293,6 @@ } double guessVerificationProgress(const BlockHash &block_hash) override { LOCK(cs_main); - assert(std::addressof(g_chainman.m_blockman) == - std::addressof(chainman().m_blockman)); return GuessVerificationProgress( Params().TxData(), chainman().m_blockman.LookupBlockIndex(block_hash)); @@ -319,8 +307,6 @@ // used to limit the range, and passing min_height that's too low or // max_height that's too high will not crash or change the result. LOCK(::cs_main); - assert(std::addressof(g_chainman.m_blockman) == - std::addressof(chainman().m_blockman)); if (CBlockIndex *block = chainman().m_blockman.LookupBlockIndex(block_hash)) { if (max_height && block->nHeight >= *max_height) { diff --git a/src/interfaces/node.cpp b/src/interfaces/node.cpp --- a/src/interfaces/node.cpp +++ b/src/interfaces/node.cpp @@ -187,8 +187,6 @@ } int getNumBlocks() override { LOCK(::cs_main); - assert(std::addressof(::ChainActive()) == - std::addressof(chainman().ActiveChain())); return chainman().ActiveChain().Height(); } BlockHash getBestBlockHash() override { @@ -199,8 +197,6 @@ } int64_t getLastBlockTime() override { LOCK(::cs_main); - assert(std::addressof(::ChainActive()) == - std::addressof(chainman().ActiveChain())); if (chainman().ActiveChain().Tip()) { return chainman().ActiveChain().Tip()->GetBlockTime(); } @@ -211,8 +207,6 @@ const CBlockIndex *tip; { LOCK(::cs_main); - assert(std::addressof(::ChainActive()) == - std::addressof(chainman().ActiveChain())); tip = chainman().ActiveChain().Tip(); } return GuessVerificationProgress(Params().TxData(), tip); @@ -252,8 +246,6 @@ } bool getUnspentOutput(const COutPoint &output, Coin &coin) override { LOCK(::cs_main); - assert(std::addressof(::ChainstateActive()) == - std::addressof(chainman().ActiveChainstate())); return chainman().ActiveChainstate().CoinsTip().GetCoin(output, coin); } diff --git a/src/miner.cpp b/src/miner.cpp --- a/src/miner.cpp +++ b/src/miner.cpp @@ -137,8 +137,6 @@ pblocktemplate->entries.emplace_back(CTransactionRef(), -SATOSHI, -1); LOCK2(cs_main, m_mempool.cs); - assert(std::addressof(*::ChainActive().Tip()) == - std::addressof(*m_chainstate.m_chain.Tip())); CBlockIndex *pindexPrev = m_chainstate.m_chain.Tip(); assert(pindexPrev != nullptr); nHeight = pindexPrev->nHeight + 1; @@ -226,8 +224,6 @@ pblocktemplate->entries[0].sigOpCount = 0; BlockValidationState state; - assert(std::addressof(::ChainstateActive()) == - std::addressof(m_chainstate)); if (!TestBlockValidity(state, chainParams, m_chainstate, *pblock, pindexPrev, BlockValidationOptions(nMaxGeneratedBlockSize) diff --git a/src/node/coin.cpp b/src/node/coin.cpp --- a/src/node/coin.cpp +++ b/src/node/coin.cpp @@ -12,8 +12,6 @@ assert(node.mempool); assert(node.chainman); LOCK2(cs_main, node.mempool->cs); - assert(std::addressof(::ChainstateActive()) == - std::addressof(node.chainman->ActiveChainstate())); CCoinsViewCache &chain_view = node.chainman->ActiveChainstate().CoinsTip(); CCoinsViewMemPool mempool_view(&chain_view, *node.mempool); for (auto &coin : coins) { diff --git a/src/node/coinstats.cpp b/src/node/coinstats.cpp --- a/src/node/coinstats.cpp +++ b/src/node/coinstats.cpp @@ -96,8 +96,6 @@ if (!pindex) { LOCK(cs_main); - assert(std::addressof(g_chainman.m_blockman) == - std::addressof(blockman)); pindex = blockman.LookupBlockIndex(view->GetBestBlock()); } stats.nHeight = Assert(pindex)->nHeight; diff --git a/src/node/transaction.cpp b/src/node/transaction.cpp --- a/src/node/transaction.cpp +++ b/src/node/transaction.cpp @@ -48,8 +48,6 @@ { // cs_main scope assert(node.chainman); LOCK(cs_main); - assert(std::addressof(::ChainstateActive()) == - std::addressof(node.chainman->ActiveChainstate())); // If the transaction is already confirmed in the chain, don't do // anything and return early. CCoinsViewCache &view = node.chainman->ActiveChainstate().CoinsTip(); diff --git a/src/rpc/mining.cpp b/src/rpc/mining.cpp --- a/src/rpc/mining.cpp +++ b/src/rpc/mining.cpp @@ -130,8 +130,6 @@ { LOCK(cs_main); - CHECK_NONFATAL(std::addressof(::ChainActive()) == - std::addressof(chainman.ActiveChain())); IncrementExtraNonce(&block, chainman.ActiveTip(), nExcessiveBlockSize, extra_nonce); } @@ -174,8 +172,6 @@ { // Don't keep cs_main locked. LOCK(cs_main); - CHECK_NONFATAL(std::addressof(::ChainActive()) == - std::addressof(chainman.ActiveChain())); nHeight = chainman.ActiveHeight(); nHeightEnd = nHeight + nGenerate; } diff --git a/src/txmempool.cpp b/src/txmempool.cpp --- a/src/txmempool.cpp +++ b/src/txmempool.cpp @@ -580,8 +580,6 @@ it != mapTx.end(); it++) { const CTransaction &tx = it->GetTx(); LockPoints lp = it->GetLockPoints(); - assert(std::addressof(::ChainstateActive()) == - std::addressof(active_chainstate)); bool validLP = TestLockPointValidity(active_chainstate.m_chain, &lp); TxValidationState state; @@ -734,15 +732,9 @@ uint64_t innerUsage = 0; CCoinsViewCache &active_coins_tip = active_chainstate.CoinsTip(); - // TODO: REVIEW-ONLY, REMOVE IN FUTURE COMMIT - assert(std::addressof(::ChainstateActive().CoinsTip()) == - std::addressof(active_coins_tip)); CCoinsViewCache mempoolDuplicate( const_cast(&active_coins_tip)); const int64_t spendheight = active_chainstate.m_chain.Height() + 1; - // TODO: REVIEW-ONLY, REMOVE IN FUTURE COMMIT - assert(g_chainman.m_blockman.GetSpendHeight(mempoolDuplicate) == - spendheight); std::list waitingOnDependants; for (indexed_transaction_set::const_iterator it = mapTx.begin(); @@ -1143,8 +1135,6 @@ std::vector vNoSpendsRemaining; TrimToSize(limit, &vNoSpendsRemaining); - assert(std::addressof(::ChainstateActive().CoinsTip()) == - std::addressof(coins_cache)); for (const COutPoint &removed : vNoSpendsRemaining) { coins_cache.Uncache(removed); } @@ -1412,8 +1402,6 @@ CTxMemPool &pool) { AssertLockHeld(cs_main); AssertLockHeld(pool.cs); - assert(std::addressof(::ChainstateActive()) == - std::addressof(active_chainstate)); std::vector txidsUpdate; // disconnectpool's insertion_order index sorts the entries from oldest to diff --git a/src/validation.cpp b/src/validation.cpp --- a/src/validation.cpp +++ b/src/validation.cpp @@ -151,8 +151,6 @@ CBlockIndex *BlockManager::LookupBlockIndex(const BlockHash &hash) const { AssertLockHeld(cs_main); - assert(std::addressof(g_chainman.BlockIndex()) == - std::addressof(m_block_index)); BlockMap::const_iterator it = m_block_index.find(hash); return it == m_block_index.end() ? nullptr : it->second; } @@ -161,7 +159,6 @@ const CBlockLocator &locator) { AssertLockHeld(cs_main); - assert(std::addressof(g_chainman.m_blockman) == std::addressof(*this)); // Find the latest block common to locator and chain - we expect that // locator.vHave is sorted descending by height. for (const BlockHash &hash : locator.vHave) { @@ -193,7 +190,6 @@ // Check whether ::ChainActive() is an extension of the block at which // the LockPoints calculation was valid. If not LockPoints are no longer // valid. - assert(std::addressof(::ChainActive()) == std::addressof(active_chain)); if (!active_chain.Contains(lp->maxInputBlock)) { return false; } @@ -208,8 +204,6 @@ bool useExistingLockPoints) { AssertLockHeld(cs_main); AssertLockHeld(pool.cs); - assert(std::addressof(::ChainstateActive()) == - std::addressof(active_chainstate)); CBlockIndex *tip = active_chainstate.m_chain.Tip(); assert(tip != nullptr); @@ -328,8 +322,6 @@ assert(txFrom->vout.size() > txin.prevout.GetN()); assert(txFrom->vout[txin.prevout.GetN()] == coin.GetTxOut()); } else { - assert(std::addressof(::ChainstateActive().CoinsTip()) == - std::addressof(coins_tip)); const Coin &coinFromDisk = coins_tip.AccessCoin(txin.prevout); assert(!coinFromDisk.IsSpent()); assert(coinFromDisk.GetTxOut() == coin.GetTxOut()); @@ -361,8 +353,6 @@ m_limit_descendant_size(gArgs.GetArg("-limitdescendantsize", DEFAULT_DESCENDANT_SIZE_LIMIT) * 1000) { - assert(std::addressof(::ChainstateActive()) == - std::addressof(m_active_chainstate)); } // We put the arguments we're handed into a struct, so we can pass them @@ -480,8 +470,6 @@ // Only accept nLockTime-using transactions that can be mined in the next // block; we don't want our mempool filled up with transactions that can't // be mined yet. - assert(std::addressof(::ChainActive()) == - std::addressof(m_active_chainstate.m_chain)); TxValidationState ctxState; if (!ContextualCheckTransactionForCurrentBlock( m_active_chainstate.m_chain.Tip(), @@ -513,8 +501,6 @@ LockPoints lp; m_view.SetBackend(m_viewmempool); - assert(std::addressof(::ChainstateActive().CoinsTip()) == - std::addressof(m_active_chainstate.CoinsTip())); const CCoinsViewCache &coins_cache = m_active_chainstate.CoinsTip(); // Do all inputs exist? for (const CTxIn &txin : tx.vin) { @@ -563,16 +549,12 @@ // that can't be mined yet. Must keep pool.cs for this unless we change // CheckSequenceLocks to take a CoinsViewCache instead of create its // own. - assert(std::addressof(::ChainstateActive()) == - std::addressof(m_active_chainstate)); if (!CheckSequenceLocks(m_active_chainstate, m_pool, tx, STANDARD_LOCKTIME_VERIFY_FLAGS, &lp)) { return state.Invalid(TxValidationResult::TX_PREMATURE_SPEND, "non-BIP68-final"); } - assert(std::addressof(g_chainman.m_blockman) == - std::addressof(m_active_chainstate.m_blockman)); Amount nFees = Amount::zero(); if (!Consensus::CheckTxInputs( tx, state, m_view, @@ -630,8 +612,6 @@ return false; } - assert(std::addressof(::ChainActive()) == - std::addressof(m_active_chainstate.m_chain)); entry.reset(new CTxMemPoolEntry( ptx, nFees, nAcceptTime, m_active_chainstate.m_chain.Height(), fSpendsCoinbase, ws.m_sig_checks_standard, lp)); @@ -679,8 +659,6 @@ // There is a similar check in CreateNewBlock() to prevent creating // invalid blocks (using TestBlockValidity), however allowing such // transactions into the mempool can be exploited as a DoS attack. - assert(std::addressof(::ChainstateActive().CoinsTip()) == - std::addressof(m_active_chainstate.CoinsTip())); int nSigChecksConsensus; if (!CheckInputsFromMempoolAndCache( tx, state, m_view, m_pool, ws.m_next_block_script_verify_flags, @@ -718,8 +696,6 @@ // Trim mempool and check if tx was trimmed. if (!bypass_limits) { - assert(std::addressof(::ChainstateActive().CoinsTip()) == - std::addressof(m_active_chainstate.CoinsTip())); m_pool.LimitSize( m_active_chainstate.CoinsTip(), gArgs.GetArg("-maxmempool", DEFAULT_MAX_MEMPOOL_SIZE) * 1000000, @@ -788,8 +764,6 @@ MemPoolAccept::ATMPArgs args{ config, state, nAcceptTime, bypass_limits, coins_to_uncache, test_accept, fee_out}; - assert(std::addressof(::ChainstateActive()) == - std::addressof(active_chainstate)); bool res = MemPoolAccept(pool, active_chainstate) .AcceptSingleTransaction(tx, args); if (!res) { @@ -957,7 +931,6 @@ void CChainState::CheckForkWarningConditions() { AssertLockHeld(cs_main); - assert(std::addressof(::ChainstateActive()) == std::addressof(*this)); // Before we get past initial download, we cannot reliably alert about forks // (we assume we don't get stuck on a fork before finishing our initial @@ -1010,7 +983,6 @@ void CChainState::CheckForkWarningConditionsOnNewFork( CBlockIndex *pindexNewForkTip) { AssertLockHeld(cs_main); - assert(std::addressof(::ChainstateActive()) == std::addressof(*this)); // If we are on a fork that is sufficiently large, set a warning flag. const CBlockIndex *pfork = m_chain.FindFork(pindexNewForkTip); @@ -1039,7 +1011,6 @@ // Called both upon regular invalid block discovery *and* InvalidateBlock void CChainState::InvalidChainFound(CBlockIndex *pindexNew) { AssertLockHeld(cs_main); - assert(std::addressof(::ChainstateActive()) == std::addressof(*this)); if (!pindexBestInvalid || pindexNew->nChainWork > pindexBestInvalid->nChainWork) { pindexBestInvalid = pindexNew; @@ -1137,7 +1108,6 @@ int BlockManager::GetSpendHeight(const CCoinsViewCache &inputs) { AssertLockHeld(cs_main); - assert(std::addressof(g_chainman.m_blockman) == std::addressof(*this)); CBlockIndex *pindexPrev = LookupBlockIndex(inputs.GetBestBlock()); return pindexPrev->nHeight + 1; } @@ -2307,8 +2277,6 @@ g_best_block_cv.notify_all(); } - assert(std::addressof(::ChainstateActive()) == - std::addressof(active_chainstate)); LogPrintf( "%s: new best=%s height=%d version=0x%08x log2_work=%f tx=%ld " "date='%s' progress=%f cache=%.1fMiB(%utxo)\n", @@ -2856,7 +2824,6 @@ bool &fInvalidFound, ConnectTrace &connectTrace) { AssertLockHeld(cs_main); AssertLockHeld(m_mempool.cs); - assert(std::addressof(::ChainstateActive()) == std::addressof(*this)); const CBlockIndex *pindexOldTip = m_chain.Tip(); const CBlockIndex *pindexFork = m_chain.FindFork(pindexMostWork); @@ -2981,8 +2948,6 @@ if (pindexHeader != pindexHeaderOld) { fNotify = true; - assert(std::addressof(::ChainstateActive()) == - std::addressof(chainstate)); fInitialBlockDownload = chainstate.IsInitialBlockDownload(); pindexHeaderOld = pindexHeader; } @@ -3256,7 +3221,6 @@ // transactions back to the mempool if disconnecting was successful, // and we're not doing a very deep invalidation (in which case // keeping the mempool up to date is probably futile anyway). - assert(std::addressof(::ChainstateActive()) == std::addressof(*this)); disconnectpool.updateMempoolForReorg( config, *this, /* fAddToMempool = */ (++disconnected <= 10) && ret, m_mempool); @@ -3666,8 +3630,6 @@ // flush it explicitly when it is lagging behind (more blocks arrive // than are being connected), we let the undo block write case // handle it - assert(std::addressof(::ChainActive()) == - std::addressof(active_chain)); finalize_undo = (vinfoBlockFile[nFile].nHeightLast == (unsigned int)active_chain.Tip()->nHeight); nFile++; @@ -3852,7 +3814,6 @@ for (const MapCheckpoints::value_type &i : reverse_iterate(checkpoints)) { const BlockHash &hash = i.second; - assert(std::addressof(g_chainman.m_blockman) == std::addressof(*this)); CBlockIndex *pindex = LookupBlockIndex(hash); if (pindex) { return pindex; @@ -3904,8 +3865,6 @@ // Don't accept any forks from the main chain prior to last checkpoint. // GetLastCheckpoint finds the last checkpoint in MapCheckpoints that's // in our BlockIndex(). - assert(std::addressof(g_chainman.m_blockman) == - std::addressof(blockman)); CBlockIndex *pcheckpoint = blockman.GetLastCheckpoint(checkpoints); if (pcheckpoint && nHeight < pcheckpoint->nHeight) { @@ -3952,8 +3911,6 @@ AssertLockHeld(cs_main); // TODO: Make active_chain_tip a reference assert(active_chain_tip); - assert(std::addressof(*::ChainActive().Tip()) == - std::addressof(*active_chain_tip)); // By convention a negative value for flags indicates that the current // network-enforced consensus rules should be used. In a future soft-fork @@ -4193,8 +4150,6 @@ bool ChainstateManager::ProcessNewBlockHeaders( const Config &config, const std::vector &headers, BlockValidationState &state, const CBlockIndex **ppindex) { - assert(std::addressof(::ChainstateActive()) == - std::addressof(ActiveChainstate())); AssertLockNotHeld(cs_main); { LOCK(cs_main); @@ -4379,7 +4334,6 @@ if (fNewBlock) { *fNewBlock = true; } - assert(std::addressof(::ChainActive()) == std::addressof(m_chain)); try { FlatFilePos blockPos = SaveBlockToDisk(block, pindex->nHeight, m_chain, chainparams, dbp); @@ -4405,8 +4359,6 @@ const Config &config, const std::shared_ptr pblock, bool fForceProcessing, bool *fNewBlock) { AssertLockNotHeld(cs_main); - assert(std::addressof(::ChainstateActive()) == - std::addressof(ActiveChainstate())); { if (fNewBlock) { @@ -4456,7 +4408,6 @@ CBlockIndex *pindexPrev, BlockValidationOptions validationOptions) { AssertLockHeld(cs_main); - assert(std::addressof(::ChainstateActive()) == std::addressof(chainstate)); assert(pindexPrev && pindexPrev == chainstate.m_chain.Tip()); CCoinsViewCache viewNew(&chainstate.CoinsTip()); BlockHash block_hash(block.GetHash()); @@ -4466,8 +4417,6 @@ indexDummy.phashBlock = &block_hash; // NOTE: CheckBlockHeader is called by CheckBlock - assert(std::addressof(g_chainman.m_blockman) == - std::addressof(chainstate.m_blockman)); if (!ContextualCheckBlockHeader(params, block, state, chainstate.m_blockman, pindexPrev, GetAdjustedTime())) { return error("%s: Consensus::ContextualCheckBlockHeader: %s", __func__, @@ -4587,8 +4536,6 @@ int nManualPruneHeight) { BlockValidationState state; const CChainParams &chainparams = Params(); - assert(std::addressof(::ChainstateActive()) == - std::addressof(active_chainstate)); if (active_chainstate.FlushStateToDisk( chainparams, state, FlushStateMode::NONE, nManualPruneHeight)) { LogPrintf("%s: failed to flush state (%s)\n", __func__, @@ -4772,7 +4719,6 @@ } bool CChainState::LoadBlockIndexDB(const Consensus::Params ¶ms) { - assert(std::addressof(::ChainstateActive()) == std::addressof(*this)); if (!m_blockman.LoadBlockIndex(params, *pblocktree, setBlockIndexCandidates)) { return false; @@ -4832,7 +4778,6 @@ void CChainState::LoadMempool(const Config &config, const ArgsManager &args) { if (args.GetArg("-persistmempool", DEFAULT_PERSIST_MEMPOOL)) { - assert(std::addressof(::ChainstateActive()) == std::addressof(*this)); ::LoadMempool(config, m_mempool, *this); } m_mempool.SetIsLoaded(!ShutdownRequested()); @@ -4880,7 +4825,6 @@ int nCheckDepth) { AssertLockHeld(cs_main); - assert(std::addressof(::ChainstateActive()) == std::addressof(chainstate)); const CChainParams ¶ms = config.GetChainParams(); const Consensus::Params &consensusParams = params.GetConsensus(); @@ -5244,7 +5188,6 @@ return true; } - assert(std::addressof(::ChainActive()) == std::addressof(m_chain)); try { const CBlock &block = chainparams.GenesisBlock(); FlatFilePos blockPos = @@ -5327,8 +5270,6 @@ { LOCK(cs_main); // detect out of order blocks, and store them for later - assert(std::addressof(g_chainman.m_blockman) == - std::addressof(m_blockman)); if (hash != chainparams.GetConsensus().hashGenesisBlock && !m_blockman.LookupBlockIndex(block.hashPrevBlock)) { LogPrint( @@ -5344,13 +5285,9 @@ } // process in case the block isn't known yet - assert(std::addressof(g_chainman.m_blockman) == - std::addressof(m_blockman)); CBlockIndex *pindex = m_blockman.LookupBlockIndex(hash); if (!pindex || !pindex->nStatus.hasData()) { BlockValidationState state; - assert(std::addressof(::ChainstateActive()) == - std::addressof(*this)); if (AcceptBlock(config, pblock, state, true, dbp, nullptr)) { nLoaded++; @@ -5372,15 +5309,11 @@ // continue if (hash == chainparams.GetConsensus().hashGenesisBlock) { BlockValidationState state; - assert(std::addressof(::ChainstateActive()) == - std::addressof(*this)); if (!ActivateBestChain(config, state, nullptr)) { break; } } - assert(std::addressof(::ChainstateActive()) == - std::addressof(*this)); NotifyHeaderTip(*this); // Recursively process earlier encountered successors of this @@ -5407,8 +5340,6 @@ head.ToString()); LOCK(cs_main); BlockValidationState dummy; - assert(std::addressof(::ChainstateActive()) == - std::addressof(*this)); if (AcceptBlock(config, pblockrecursive, dummy, true, &it->second, nullptr)) { nLoaded++; @@ -5417,8 +5348,6 @@ } range.first++; mapBlocksUnknownParent.erase(it); - assert(std::addressof(::ChainstateActive()) == - std::addressof(*this)); NotifyHeaderTip(*this); } } @@ -5853,8 +5782,6 @@ TxValidationState state; if (nTime > nNow - nExpiryTimeout) { LOCK(cs_main); - assert(std::addressof(::ChainstateActive()) == - std::addressof(active_chainstate)); AcceptToMemoryPoolWithTime( config, pool, active_chainstate, state, tx, nTime, false /* bypass_limits */, false /* test_accept */);