mirror of
https://github.com/bitcoin/bitcoin.git
synced 2026-06-08 21:59:10 +02:00
Merge #10550: Don't return stale data from CCoinsViewCache::Cursor()
3ff1fa8Use override keyword on CCoinsView overrides (Russell Yanofsky)24e44c3Don't return stale data from CCoinsViewCache::Cursor() (Russell Yanofsky) Tree-SHA512: 08699dae0925ffb9c018f02612ac6b7eaf73ec331e2f4f934f1fe25a2ce120735fa38596926e924897c203f7470e99f0a99cf70d2ce31ff428b105e16583a861
This commit is contained in:
@@ -36,7 +36,7 @@ class CCoinsViewTest : public CCoinsView
|
||||
std::map<COutPoint, Coin> map_;
|
||||
|
||||
public:
|
||||
bool GetCoin(const COutPoint& outpoint, Coin& coin) const
|
||||
bool GetCoin(const COutPoint& outpoint, Coin& coin) const override
|
||||
{
|
||||
std::map<COutPoint, Coin>::const_iterator it = map_.find(outpoint);
|
||||
if (it == map_.end()) {
|
||||
@@ -50,15 +50,15 @@ public:
|
||||
return true;
|
||||
}
|
||||
|
||||
bool HaveCoin(const COutPoint& outpoint) const
|
||||
bool HaveCoin(const COutPoint& outpoint) const override
|
||||
{
|
||||
Coin coin;
|
||||
return GetCoin(outpoint, coin);
|
||||
}
|
||||
|
||||
uint256 GetBestBlock() const { return hashBestBlock_; }
|
||||
uint256 GetBestBlock() const override { return hashBestBlock_; }
|
||||
|
||||
bool BatchWrite(CCoinsMap& mapCoins, const uint256& hashBlock)
|
||||
bool BatchWrite(CCoinsMap& mapCoins, const uint256& hashBlock) override
|
||||
{
|
||||
for (CCoinsMap::iterator it = mapCoins.begin(); it != mapCoins.end(); ) {
|
||||
if (it->second.flags & CCoinsCacheEntry::DIRTY) {
|
||||
|
||||
Reference in New Issue
Block a user