diff options
author | Pieter Wuille <pieter.wuille@gmail.com> | 2016-06-03 01:11:02 +0200 |
---|---|---|
committer | Pieter Wuille <pieter.wuille@gmail.com> | 2016-06-03 01:26:50 +0200 |
commit | a82f03393a32842d49236e8666ee57805ca701f8 (patch) | |
tree | 05461f94d40c52fa0f73dd85ae91026b24211871 /src/main.cpp | |
parent | f972b04d63eb8af79ff3cec1dc561ed13dfa6053 (diff) | |
parent | 9805f4af7ecb6becf8a146bd845fb131ffa625c9 (diff) | |
download | bitcoin-a82f03393a32842d49236e8666ee57805ca701f8.tar.xz |
Merge #7997: replace mapNextTx with slimmer setSpends
9805f4a mapNextTx: use pointer as key, simplify value (Kaz Wesley)
Diffstat (limited to 'src/main.cpp')
-rw-r--r-- | src/main.cpp | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/src/main.cpp b/src/main.cpp index 162c8b986c..48f5dae4ff 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -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 |