Merge #7997: replace mapNextTx with slimmer setSpends

9805f4a mapNextTx: use pointer as key, simplify value (Kaz Wesley)
This commit is contained in:
Pieter Wuille
2016-06-03 01:11:02 +02:00
6 changed files with 96 additions and 41 deletions

View File

@@ -1054,9 +1054,10 @@ bool AcceptToMemoryPoolWorker(CTxMemPool& pool, CValidationState& state, const C
LOCK(pool.cs); // protect pool.mapNextTx
BOOST_FOREACH(const CTxIn &txin, tx.vin)
{
if (pool.mapNextTx.count(txin.prevout))
auto itConflicting = pool.mapNextTx.find(txin.prevout);
if (itConflicting != pool.mapNextTx.end())
{
const CTransaction *ptxConflicting = pool.mapNextTx[txin.prevout].ptx;
const CTransaction *ptxConflicting = itConflicting->second;
if (!setConflicts.count(ptxConflicting->GetHash()))
{
// Allow opt-out of transaction replacement by setting