replace mapNextTx with slimmer setSpends

This commit is contained in:
Kaz Wesley
2016-04-30 21:45:26 -07:00
committed by lateminer
parent 17401c86d1
commit 000a97ca5f
6 changed files with 96 additions and 41 deletions

View File

@@ -1119,7 +1119,8 @@ bool AcceptToMemoryPoolWorker(CTxMemPool& pool, CValidationState& state, const C
{
COutPoint outpoint = txin.prevout;
// A respend is a tx that conflicts with a member of the pool
if (pool.mapNextTx.count(txin.prevout))
auto itConflicting = pool.mapNextTx.find(txin.prevout);
if (itConflicting != pool.mapNextTx.end())
{
fRespend = true;
// Relay only one tx per respent outpoint, but not if tx is equivalent to pool member
@@ -1129,7 +1130,7 @@ bool AcceptToMemoryPoolWorker(CTxMemPool& pool, CValidationState& state, const C
break;
}
/*
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