MOVEONLY: remove single-use helper func CheckInputsAndUpdateCoins
This commit is contained in:
1 parent
e8639ec26a
commit
09d18916af
1 file changed
+5
-10
+5
-10
@@ -671,15 +671,6 @@ void CTxMemPool::clear()
|
|||||||
_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
|
void CTxMemPool::check(CChainState& active_chainstate) const
|
||||||
{
|
{
|
||||||
if (m_check_ratio == 0) return;
|
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...
|
// just a sanity check, not definitive that this calc is correct...
|
||||||
assert(it->GetSizeWithDescendants() >= child_sizes + it->GetTxSize());
|
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++) {
|
for (auto it = mapNextTx.cbegin(); it != mapNextTx.cend(); it++) {
|
||||||
uint256 hash = it->second->GetHash();
|
uint256 hash = it->second->GetHash();
|
||||||
|
|||||||
Reference in new issue
Block a user