From 082c5bf099c64e3d27abe9b68a71ce500b693e7e Mon Sep 17 00:00:00 2001 From: glozow Date: Wed, 29 Sep 2021 19:36:01 +0100 Subject: [refactor] pass coinsview and height to check() Removes check's dependency on validation.h --- src/txmempool.cpp | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) (limited to 'src/txmempool.cpp') diff --git a/src/txmempool.cpp b/src/txmempool.cpp index f65fb24f19..a0d9e2a6bf 100644 --- a/src/txmempool.cpp +++ b/src/txmempool.cpp @@ -672,7 +672,7 @@ void CTxMemPool::clear() _clear(); } -void CTxMemPool::check(CChainState& active_chainstate) const +void CTxMemPool::check(const CCoinsViewCache& active_coins_tip, int64_t spendheight) const { if (m_check_ratio == 0) return; @@ -687,9 +687,7 @@ void CTxMemPool::check(CChainState& active_chainstate) const uint64_t innerUsage = 0; uint64_t prev_ancestor_count{0}; - CCoinsViewCache& active_coins_tip = active_chainstate.CoinsTip(); CCoinsViewCache mempoolDuplicate(const_cast(&active_coins_tip)); - const int64_t spendheight = active_chainstate.m_chain.Height() + 1; for (const auto& it : GetSortedDepthAndScore()) { checkTotal += it->GetTxSize(); -- cgit v1.2.3