mirror of
https://github.com/bitcoin/bitcoin.git
synced 2026-01-19 06:43:45 +01:00
[refactor] pass coinsview and height to check()
Removes check's dependency on validation.h
This commit is contained in:
@@ -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();
|
||||
|
||||
Reference in New Issue
Block a user