diff options
author | glozow <gloriajzhao@gmail.com> | 2021-09-29 19:10:44 +0100 |
---|---|---|
committer | glozow <gloriajzhao@gmail.com> | 2021-10-04 15:00:28 +0100 |
commit | 09d18916afb0ecae90700d4befd9d5dc52767970 (patch) | |
tree | 7bd33a74e30d89d61cbda9949aa23acde70e2ac7 | |
parent | e8639ec26aaf4de3fae280963434bf1cf2017b6f (diff) | |
download | bitcoin-09d18916afb0ecae90700d4befd9d5dc52767970.tar.xz |
MOVEONLY: remove single-use helper func CheckInputsAndUpdateCoins
-rw-r--r-- | src/txmempool.cpp | 15 |
1 files changed, 5 insertions, 10 deletions
diff --git a/src/txmempool.cpp b/src/txmempool.cpp index 2decc153f2..40e142dc47 100644 --- a/src/txmempool.cpp +++ b/src/txmempool.cpp @@ -671,15 +671,6 @@ void CTxMemPool::clear() _clear(); } -static void CheckInputsAndUpdateCoins(const CTransaction& tx, CCoinsViewCache& mempoolDuplicate, const int64_t spendheight) -{ - TxValidationState dummy_state; // Not used. CheckTxInputs() should always pass - CAmount txfee = 0; - bool fCheckResult = tx.IsCoinBase() || Consensus::CheckTxInputs(tx, dummy_state, mempoolDuplicate, spendheight, txfee); - assert(fCheckResult); - UpdateCoins(tx, mempoolDuplicate, std::numeric_limits<int>::max()); -} - void CTxMemPool::check(CChainState& active_chainstate) const { if (m_check_ratio == 0) return; @@ -772,7 +763,11 @@ void CTxMemPool::check(CChainState& active_chainstate) const // just a sanity check, not definitive that this calc is correct... assert(it->GetSizeWithDescendants() >= child_sizes + it->GetTxSize()); - CheckInputsAndUpdateCoins(tx, mempoolDuplicate, spendheight); + TxValidationState dummy_state; // Not used. CheckTxInputs() should always pass + CAmount txfee = 0; + bool fCheckResult = tx.IsCoinBase() || Consensus::CheckTxInputs(tx, dummy_state, mempoolDuplicate, spendheight, txfee); + assert(fCheckResult); + UpdateCoins(tx, mempoolDuplicate, std::numeric_limits<int>::max()); } for (auto it = mapNextTx.cbegin(); it != mapNextTx.cend(); it++) { uint256 hash = it->second->GetHash(); |