diff options
| author | Pieter Wuille <[email protected]> | 2016-06-03 01:11:02 +0200 |
|---|---|---|
| committer | Pieter Wuille <[email protected]> | 2016-06-03 01:26:50 +0200 |
| commit | a82f03393a32842d49236e8666ee57805ca701f8 (patch) | |
| tree | 05461f94d40c52fa0f73dd85ae91026b24211871 /src/main.cpp | |
| parent | Merge #7825: Prevent multiple calls to ExtractDestination (diff) | |
| parent | mapNextTx: use pointer as key, simplify value (diff) | |
| download | discoin-a82f03393a32842d49236e8666ee57805ca701f8.tar.xz discoin-a82f03393a32842d49236e8666ee57805ca701f8.zip | |
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 162c8b986..48f5dae4f 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 |