Skip to content

Commit 09d1891

Browse files
committed
MOVEONLY: remove single-use helper func CheckInputsAndUpdateCoins
1 parent e8639ec commit 09d1891

File tree

1 file changed

+5
-10
lines changed

1 file changed

+5
-10
lines changed

src/txmempool.cpp

Lines changed: 5 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -671,15 +671,6 @@ void CTxMemPool::clear()
671671
_clear();
672672
}
673673

674-
static void CheckInputsAndUpdateCoins(const CTransaction& tx, CCoinsViewCache& mempoolDuplicate, const int64_t spendheight)
675-
{
676-
TxValidationState dummy_state; // Not used. CheckTxInputs() should always pass
677-
CAmount txfee = 0;
678-
bool fCheckResult = tx.IsCoinBase() || Consensus::CheckTxInputs(tx, dummy_state, mempoolDuplicate, spendheight, txfee);
679-
assert(fCheckResult);
680-
UpdateCoins(tx, mempoolDuplicate, std::numeric_limits<int>::max());
681-
}
682-
683674
void CTxMemPool::check(CChainState& active_chainstate) const
684675
{
685676
if (m_check_ratio == 0) return;
@@ -772,7 +763,11 @@ void CTxMemPool::check(CChainState& active_chainstate) const
772763
// just a sanity check, not definitive that this calc is correct...
773764
assert(it->GetSizeWithDescendants() >= child_sizes + it->GetTxSize());
774765

775-
CheckInputsAndUpdateCoins(tx, mempoolDuplicate, spendheight);
766+
TxValidationState dummy_state; // Not used. CheckTxInputs() should always pass
767+
CAmount txfee = 0;
768+
bool fCheckResult = tx.IsCoinBase() || Consensus::CheckTxInputs(tx, dummy_state, mempoolDuplicate, spendheight, txfee);
769+
assert(fCheckResult);
770+
UpdateCoins(tx, mempoolDuplicate, std::numeric_limits<int>::max());
776771
}
777772
for (auto it = mapNextTx.cbegin(); it != mapNextTx.cend(); it++) {
778773
uint256 hash = it->second->GetHash();

0 commit comments

Comments
 (0)