Browse Source

Make CCoinsViewCache's copy constructor private

It is easily confused with CCoinsViewCache(CCoinsView*), which creates a sub-cache, but instead of creating a sub-cache, the copy constructor would copy the original and use that original's base, defeating the intended isolation.
0.13
Luke Dashjr 10 years ago
parent
commit
228d238525
  1. 5
      src/coins.h

5
src/coins.h

@ -441,6 +441,11 @@ public:
private: private:
CCoinsMap::iterator FetchCoins(const uint256 &txid); CCoinsMap::iterator FetchCoins(const uint256 &txid);
CCoinsMap::const_iterator FetchCoins(const uint256 &txid) const; CCoinsMap::const_iterator FetchCoins(const uint256 &txid) const;
/**
* By making the copy constructor private, we prevent accidentally using it when one intends to create a cache on top of a base cache.
*/
CCoinsViewCache(const CCoinsViewCache &);
}; };
#endif // BITCOIN_COINS_H #endif // BITCOIN_COINS_H

Loading…
Cancel
Save