aboutsummaryrefslogtreecommitdiff
path: root/src/txmempool.cpp
diff options
context:
space:
mode:
authorglozow <gloriajzhao@gmail.com>2021-09-29 19:36:01 +0100
committerglozow <gloriajzhao@gmail.com>2021-10-04 15:00:28 +0100
commit082c5bf099c64e3d27abe9b68a71ce500b693e7e (patch)
treede3cef3823de0046834bbf621ba3a32e2b09042d /src/txmempool.cpp
parented6115f1eae0eb4669601106a9aaff078a2f3a74 (diff)
downloadbitcoin-082c5bf099c64e3d27abe9b68a71ce500b693e7e.tar.xz
[refactor] pass coinsview and height to check()
Removes check's dependency on validation.h
Diffstat (limited to 'src/txmempool.cpp')
-rw-r--r--src/txmempool.cpp4
1 files changed, 1 insertions, 3 deletions
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<CCoinsViewCache*>(&active_coins_tip));
- const int64_t spendheight = active_chainstate.m_chain.Height() + 1;
for (const auto& it : GetSortedDepthAndScore()) {
checkTotal += it->GetTxSize();