Skip to content

Commit 3ff1fa8

Browse files
committed
Use override keyword on CCoinsView overrides
1 parent 24e44c3 commit 3ff1fa8

File tree

2 files changed

+9
-9
lines changed

2 files changed

+9
-9
lines changed

src/coins.h

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -207,12 +207,12 @@ class CCoinsViewCache : public CCoinsViewBacked
207207
CCoinsViewCache(CCoinsView *baseIn);
208208

209209
// Standard CCoinsView methods
210-
bool GetCoin(const COutPoint &outpoint, Coin &coin) const;
211-
bool HaveCoin(const COutPoint &outpoint) const;
212-
uint256 GetBestBlock() const;
210+
bool GetCoin(const COutPoint &outpoint, Coin &coin) const override;
211+
bool HaveCoin(const COutPoint &outpoint) const override;
212+
uint256 GetBestBlock() const override;
213213
void SetBestBlock(const uint256 &hashBlock);
214-
bool BatchWrite(CCoinsMap &mapCoins, const uint256 &hashBlock);
215-
CCoinsViewCursor* Cursor() const {
214+
bool BatchWrite(CCoinsMap &mapCoins, const uint256 &hashBlock) override;
215+
CCoinsViewCursor* Cursor() const override {
216216
throw std::logic_error("CCoinsViewCache cursor iteration not supported.");
217217
}
218218

src/test/coins_tests.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ class CCoinsViewTest : public CCoinsView
3737
std::map<COutPoint, Coin> map_;
3838

3939
public:
40-
bool GetCoin(const COutPoint& outpoint, Coin& coin) const
40+
bool GetCoin(const COutPoint& outpoint, Coin& coin) const override
4141
{
4242
std::map<COutPoint, Coin>::const_iterator it = map_.find(outpoint);
4343
if (it == map_.end()) {
@@ -51,15 +51,15 @@ class CCoinsViewTest : public CCoinsView
5151
return true;
5252
}
5353

54-
bool HaveCoin(const COutPoint& outpoint) const
54+
bool HaveCoin(const COutPoint& outpoint) const override
5555
{
5656
Coin coin;
5757
return GetCoin(outpoint, coin);
5858
}
5959

60-
uint256 GetBestBlock() const { return hashBestBlock_; }
60+
uint256 GetBestBlock() const override { return hashBestBlock_; }
6161

62-
bool BatchWrite(CCoinsMap& mapCoins, const uint256& hashBlock)
62+
bool BatchWrite(CCoinsMap& mapCoins, const uint256& hashBlock) override
6363
{
6464
for (CCoinsMap::iterator it = mapCoins.begin(); it != mapCoins.end(); ) {
6565
if (it->second.flags & CCoinsCacheEntry::DIRTY) {

0 commit comments

Comments
 (0)