mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-02-22 06:52:36 +01:00
[mempool] always assert coin spent
This is an extremely cheap function (just checks that the coin CTxOut isn't null) that doesn't need to be gated on check_ratio.
This commit is contained in:
parent
bb9078ed51
commit
64e4963c63
1 changed files with 1 additions and 1 deletions
|
@ -660,7 +660,7 @@ void CTxMemPool::removeForReorg(CChainState& active_chainstate, int flags)
|
||||||
if (it2 != mapTx.end())
|
if (it2 != mapTx.end())
|
||||||
continue;
|
continue;
|
||||||
const Coin &coin = active_chainstate.CoinsTip().AccessCoin(txin.prevout);
|
const Coin &coin = active_chainstate.CoinsTip().AccessCoin(txin.prevout);
|
||||||
if (m_check_ratio != 0) assert(!coin.IsSpent());
|
assert(!coin.IsSpent());
|
||||||
unsigned int nMemPoolHeight = active_chainstate.m_chain.Tip()->nHeight + 1;
|
unsigned int nMemPoolHeight = active_chainstate.m_chain.Tip()->nHeight + 1;
|
||||||
if (coin.IsSpent() || (coin.IsCoinBase() && ((signed long)nMemPoolHeight) - coin.nHeight < COINBASE_MATURITY)) {
|
if (coin.IsSpent() || (coin.IsCoinBase() && ((signed long)nMemPoolHeight) - coin.nHeight < COINBASE_MATURITY)) {
|
||||||
should_remove = true;
|
should_remove = true;
|
||||||
|
|
Loading…
Add table
Reference in a new issue