diff options
| author | Pieter Wuille <[email protected]> | 2017-06-13 12:17:30 -0700 |
|---|---|---|
| committer | Pieter Wuille <[email protected]> | 2017-06-26 16:16:26 -0700 |
| commit | 21180ff73436e198b6828c312ddfd0a1195447b2 (patch) | |
| tree | 32541dfda7113742cc54340eda7e859ab62869ce /src/txmempool.cpp | |
| parent | Merge #10559: Change semantics of HaveCoinInCache to match HaveCoin (diff) | |
| download | discoin-21180ff73436e198b6828c312ddfd0a1195447b2.tar.xz discoin-21180ff73436e198b6828c312ddfd0a1195447b2.zip | |
Simplify return values of GetCoin/HaveCoin(InCache)
This removes the possibility for GetCoin/HaveCoin/HaveCoinInCache to return
true while the respective coin is spent. By doing it across all calls, some
extra checks can be eliminated.
coins_tests is modified to call HaveCoin sometimes before and sometimes
after AccessCoin. A further change is needed because the semantics for
GetCoin slightly changed, causing a pruned entry in the parent cache to not
be pulled into the child in FetchCoin.
Diffstat (limited to 'src/txmempool.cpp')
| -rw-r--r-- | src/txmempool.cpp | 6 |
1 files changed, 1 insertions, 5 deletions
diff --git a/src/txmempool.cpp b/src/txmempool.cpp index 8deb703d2..dcfc5ffde 100644 --- a/src/txmempool.cpp +++ b/src/txmempool.cpp @@ -903,11 +903,7 @@ bool CCoinsViewMemPool::GetCoin(const COutPoint &outpoint, Coin &coin) const { return false; } } - return (base->GetCoin(outpoint, coin) && !coin.IsSpent()); -} - -bool CCoinsViewMemPool::HaveCoin(const COutPoint &outpoint) const { - return mempool.exists(outpoint) || base->HaveCoin(outpoint); + return base->GetCoin(outpoint, coin); } size_t CTxMemPool::DynamicMemoryUsage() const { |