From 21180ff73436e198b6828c312ddfd0a1195447b2 Mon Sep 17 00:00:00 2001 From: Pieter Wuille Date: Tue, 13 Jun 2017 12:17:30 -0700 Subject: 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. --- src/txmempool.h | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'src/txmempool.h') diff --git a/src/txmempool.h b/src/txmempool.h index 7ca3b18a1e..78ac3c209b 100644 --- a/src/txmempool.h +++ b/src/txmempool.h @@ -684,8 +684,7 @@ protected: public: CCoinsViewMemPool(CCoinsView* baseIn, const CTxMemPool& mempoolIn); - bool GetCoin(const COutPoint &outpoint, Coin &coin) const; - bool HaveCoin(const COutPoint &outpoint) const; + bool GetCoin(const COutPoint &outpoint, Coin &coin) const override; }; /** -- cgit v1.2.3