diff options
Diffstat (limited to 'src/coins.h')
-rw-r--r-- | src/coins.h | 47 |
1 files changed, 0 insertions, 47 deletions
diff --git a/src/coins.h b/src/coins.h index 5879530f95..fcf7c47a56 100644 --- a/src/coins.h +++ b/src/coins.h @@ -405,36 +405,10 @@ public: }; -class CCoinsViewCache; - -/** - * A reference to a mutable cache entry. Encapsulating it allows us to run - * cleanup code after the modification is finished, and keeping track of - * concurrent modifications. - */ -class CCoinsModifier -{ -private: - CCoinsViewCache& cache; - CCoinsMap::iterator it; - size_t cachedCoinUsage; // Cached memory usage of the CCoins object before modification - CCoinsModifier(CCoinsViewCache& cache_, CCoinsMap::iterator it_, size_t usage); - -public: - CCoins* operator->() { return &it->second.coins; } - CCoins& operator*() { return it->second.coins; } - ~CCoinsModifier(); - friend class CCoinsViewCache; -}; - /** CCoinsView that adds a memory cache for transactions to another CCoinsView */ class CCoinsViewCache : public CCoinsViewBacked { protected: - /* Whether this cache has an active modifier. */ - bool hasModifier; - - /** * Make mutable so that we can "fill the cache" even from Get-methods * declared as "const". @@ -447,7 +421,6 @@ protected: public: CCoinsViewCache(CCoinsView *baseIn); - ~CCoinsViewCache(); // Standard CCoinsView methods bool GetCoins(const uint256 &txid, CCoins &coins) const; @@ -480,24 +453,6 @@ public: const Coin AccessCoin(const COutPoint &output) const; /** - * Return a modifiable reference to a CCoins. If no entry with the given - * txid exists, a new one is created. Simultaneous modifications are not - * allowed. - */ - CCoinsModifier ModifyCoins(const uint256 &txid); - - /** - * Return a modifiable reference to a CCoins. Assumes that no entry with the given - * txid exists and creates a new one. This saves a database access in the case where - * the coins were to be wiped out by FromTx anyway. This should not be called with - * the 2 historical coinbase duplicate pairs because the new coins are marked fresh, and - * in the event the duplicate coinbase was spent before a flush, the now pruned coins - * would not properly overwrite the first coinbase of the pair. Simultaneous modifications - * are not allowed. - */ - CCoinsModifier ModifyNewCoins(const uint256 &txid, bool coinbase); - - /** * Add a coin. Set potential_overwrite to true if a non-pruned version may * already exist. */ @@ -544,8 +499,6 @@ public: const CTxOut &GetOutputFor(const CTxIn& input) const; - friend class CCoinsModifier; - private: CCoinsMap::iterator FetchCoins(const uint256 &txid) const; |