@@ -704,14 +704,12 @@ void CTxMemPool::check(CChainState& active_chainstate) const
704
704
if (it2 != mapTx.end ()) {
705
705
const CTransaction& tx2 = it2->GetTx ();
706
706
assert (tx2.vout .size () > txin.prevout .n && !tx2.vout [txin.prevout .n ].IsNull ());
707
- // We are iterating through the mempool entries sorted in order by ancestor count.
708
- // All parents must have been checked before their children and their coins added to
709
- // the mempoolDuplicate coins cache.
710
- assert (mempoolDuplicate.HaveCoin (txin.prevout ));
711
707
setParentCheck.insert (*it2);
712
- } else {
713
- assert (active_coins_tip.HaveCoin (txin.prevout ));
714
708
}
709
+ // We are iterating through the mempool entries sorted in order by ancestor count.
710
+ // All parents must have been checked before their children and their coins added to
711
+ // the mempoolDuplicate coins cache.
712
+ assert (mempoolDuplicate.HaveCoin (txin.prevout ));
715
713
// Check whether its inputs are marked in mapNextTx.
716
714
auto it3 = mapNextTx.find (txin.prevout );
717
715
assert (it3 != mapNextTx.end ());
@@ -766,8 +764,8 @@ void CTxMemPool::check(CChainState& active_chainstate) const
766
764
767
765
TxValidationState dummy_state; // Not used. CheckTxInputs() should always pass
768
766
CAmount txfee = 0 ;
769
- bool fCheckResult = tx.IsCoinBase () || Consensus::CheckTxInputs (tx, dummy_state, mempoolDuplicate, spendheight, txfee );
770
- assert (fCheckResult );
767
+ assert (! tx.IsCoinBase ());
768
+ assert (Consensus::CheckTxInputs (tx, dummy_state, mempoolDuplicate, spendheight, txfee) );
771
769
for (const auto & input: tx.vin ) mempoolDuplicate.SpendCoin (input.prevout );
772
770
AddCoins (mempoolDuplicate, tx, std::numeric_limits<int >::max ());
773
771
}
0 commit comments