mirror of
https://github.com/ElementsProject/elements.git
synced 2026-08-19 13:27:35 +02:00
[refactor] pass coinsview and height to check()
Removes check's dependency on validation.h
This commit is contained in:
parent
ed6115f1ea
commit
082c5bf099
6 changed files with 11 additions and 10 deletions
|
|
@ -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();
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue