Skip to content

Commit 30c2130

Browse files
committed
Merge #10685: Clarify CCoinsViewMemPool documentation.
381b8fc Clarify CCoinsViewMemPool documentation. (Matt Corallo) Tree-SHA512: 0d1520595a03ea4038b4119871d79dfc28a50f42ac7667b30a583805d4fe4b0480a6912b9b4f7660c7223778ef85f2f9d1870551383a35c5e8c88cd2935f59d3
2 parents d4e551a + 381b8fc commit 30c2130

File tree

2 files changed

+8
-1
lines changed

2 files changed

+8
-1
lines changed

src/rpc/blockchain.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -991,7 +991,7 @@ UniValue gettxout(const JSONRPCRequest& request)
991991
if (fMempool) {
992992
LOCK(mempool.cs);
993993
CCoinsViewMemPool view(pcoinsTip, mempool);
994-
if (!view.GetCoin(out, coin) || mempool.isSpent(out)) { // TODO: filtering spent coins should be done by the CCoinsViewMemPool
994+
if (!view.GetCoin(out, coin) || mempool.isSpent(out)) {
995995
return NullUniValue;
996996
}
997997
} else {

src/txmempool.h

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -669,6 +669,13 @@ class CTxMemPool
669669
/**
670670
* CCoinsView that brings transactions from a memorypool into view.
671671
* It does not check for spendings by memory pool transactions.
672+
* Instead, it provides access to all Coins which are either unspent in the
673+
* base CCoinsView, or are outputs from any mempool transaction!
674+
* This allows transaction replacement to work as expected, as you want to
675+
* have all inputs "available" to check signatures, and any cycles in the
676+
* dependency graph are checked directly in AcceptToMemoryPool.
677+
* It also allows you to sign a double-spend directly in signrawtransaction,
678+
* as long as the conflicting transaction is not yet confirmed.
672679
*/
673680
class CCoinsViewMemPool : public CCoinsViewBacked
674681
{

0 commit comments

Comments
 (0)