diff --git a/src/coins.h b/src/coins.h --- a/src/coins.h +++ b/src/coins.h @@ -232,9 +232,14 @@ bool HaveCoinInCache(const COutPoint &outpoint) const; /** - * Return a reference to a Coin in the cache, or a pruned one if not found. - * This is more efficient than GetCoin. Modifications to other cache entries - * are allowed while accessing the returned pointer. + * Return a reference to Coin in the cache, or a pruned one if not found. + * This is more efficient than GetCoin. + * + * Generally, do not hold the reference returned for more than a short + * scope. While the current implementation allows for modifications to the + * contents of the cache while holding the reference, this behavior should + * not be relied on! To be safe, best to not hold the returned reference + * through any other calls to this cache. */ const Coin &AccessCoin(const COutPoint &output) const; diff --git a/src/txmempool.cpp b/src/txmempool.cpp --- a/src/txmempool.cpp +++ b/src/txmempool.cpp @@ -1201,9 +1201,7 @@ if (exists(txin.prevout.GetTxId())) { continue; } - if (!mapNextTx.count(txin.prevout)) { - pvNoSpendsRemaining->push_back(txin.prevout); - } + pvNoSpendsRemaining->push_back(txin.prevout); } } }