From 3ff1fa8c4a6198ebc277bbf814b4e07bf78eb98a Mon Sep 17 00:00:00 2001 From: Russell Yanofsky Date: Thu, 8 Jun 2017 09:28:28 -0400 Subject: [PATCH] Use override keyword on CCoinsView overrides --- src/coins.h | 10 +++++----- src/test/coins_tests.cpp | 8 ++++---- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/src/coins.h b/src/coins.h index b10c7ea9a..833e066c3 100644 --- a/src/coins.h +++ b/src/coins.h @@ -207,12 +207,12 @@ public: CCoinsViewCache(CCoinsView *baseIn); // Standard CCoinsView methods - bool GetCoin(const COutPoint &outpoint, Coin &coin) const; - bool HaveCoin(const COutPoint &outpoint) const; - uint256 GetBestBlock() const; + bool GetCoin(const COutPoint &outpoint, Coin &coin) const override; + bool HaveCoin(const COutPoint &outpoint) const override; + uint256 GetBestBlock() const override; void SetBestBlock(const uint256 &hashBlock); - bool BatchWrite(CCoinsMap &mapCoins, const uint256 &hashBlock); - CCoinsViewCursor* Cursor() const { + bool BatchWrite(CCoinsMap &mapCoins, const uint256 &hashBlock) override; + CCoinsViewCursor* Cursor() const override { throw std::logic_error("CCoinsViewCache cursor iteration not supported."); } diff --git a/src/test/coins_tests.cpp b/src/test/coins_tests.cpp index 0ed71b96f..40801ab16 100644 --- a/src/test/coins_tests.cpp +++ b/src/test/coins_tests.cpp @@ -37,7 +37,7 @@ class CCoinsViewTest : public CCoinsView std::map map_; public: - bool GetCoin(const COutPoint& outpoint, Coin& coin) const + bool GetCoin(const COutPoint& outpoint, Coin& coin) const override { std::map::const_iterator it = map_.find(outpoint); if (it == map_.end()) { @@ -51,15 +51,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) {