|
|
|
@ -11,6 +11,7 @@
@@ -11,6 +11,7 @@
|
|
|
|
|
#include "main.h" |
|
|
|
|
#include "policy/fees.h" |
|
|
|
|
#include "streams.h" |
|
|
|
|
#include "timedata.h" |
|
|
|
|
#include "util.h" |
|
|
|
|
#include "utilmoneystr.h" |
|
|
|
|
#include "utiltime.h" |
|
|
|
@ -478,13 +479,16 @@ void CTxMemPool::remove(const CTransaction &origTx, std::list<CTransaction>& rem
@@ -478,13 +479,16 @@ void CTxMemPool::remove(const CTransaction &origTx, std::list<CTransaction>& rem
|
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
void CTxMemPool::removeCoinbaseSpends(const CCoinsViewCache *pcoins, unsigned int nMemPoolHeight) |
|
|
|
|
void CTxMemPool::removeForReorg(const CCoinsViewCache *pcoins, unsigned int nMemPoolHeight) |
|
|
|
|
{ |
|
|
|
|
// Remove transactions spending a coinbase which are now immature
|
|
|
|
|
LOCK(cs); |
|
|
|
|
list<CTransaction> transactionsToRemove; |
|
|
|
|
for (indexed_transaction_set::const_iterator it = mapTx.begin(); it != mapTx.end(); it++) { |
|
|
|
|
const CTransaction& tx = it->GetTx(); |
|
|
|
|
if (!IsFinalTx(tx, nMemPoolHeight, GetAdjustedTime())) { |
|
|
|
|
transactionsToRemove.push_back(tx); |
|
|
|
|
} else { |
|
|
|
|
BOOST_FOREACH(const CTxIn& txin, tx.vin) { |
|
|
|
|
indexed_transaction_set::const_iterator it2 = mapTx.find(txin.prevout.hash); |
|
|
|
|
if (it2 != mapTx.end()) |
|
|
|
@ -497,6 +501,7 @@ void CTxMemPool::removeCoinbaseSpends(const CCoinsViewCache *pcoins, unsigned in
@@ -497,6 +501,7 @@ void CTxMemPool::removeCoinbaseSpends(const CCoinsViewCache *pcoins, unsigned in
|
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
BOOST_FOREACH(const CTransaction& tx, transactionsToRemove) { |
|
|
|
|
list<CTransaction> removed; |
|
|
|
|
remove(tx, removed, true); |
|
|
|
|