Skip to content

Commit 95b7c38

Browse files
author
Sergey
committed
Use override keyword for all overriden functions
1 parent 580c488 commit 95b7c38

20 files changed

+67
-65
lines changed

src/governance-exceptions.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ class CGovernanceException : public std::exception
7676

7777
virtual ~CGovernanceException() throw() {}
7878

79-
virtual const char* what() const throw()
79+
virtual const char* what() const throw() override
8080
{
8181
return strMessage.c_str();
8282
}

src/httprpc.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -48,11 +48,11 @@ class HTTPRPCTimerInterface : public RPCTimerInterface
4848
HTTPRPCTimerInterface(struct event_base* _base) : base(_base)
4949
{
5050
}
51-
const char* Name()
51+
const char* Name() override
5252
{
5353
return "HTTP";
5454
}
55-
RPCTimerBase* NewTimer(boost::function<void(void)>& func, int64_t millis)
55+
RPCTimerBase* NewTimer(boost::function<void(void)>& func, int64_t millis) override
5656
{
5757
return new HTTPRPCTimer(base, func, millis);
5858
}

src/httpserver.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ class HTTPWorkItem : public HTTPClosure
4646
req(std::move(_req)), path(_path), func(_func)
4747
{
4848
}
49-
void operator()()
49+
void operator()() override
5050
{
5151
func(req.get(), path);
5252
}

src/keystore.h

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -64,9 +64,9 @@ class CBasicKeyStore : public CKeyStore
6464
CHDChain hdChain;
6565

6666
public:
67-
bool AddKeyPubKey(const CKey& key, const CPubKey &pubkey);
68-
bool GetPubKey(const CKeyID &address, CPubKey& vchPubKeyOut) const;
69-
bool HaveKey(const CKeyID &address) const
67+
bool AddKeyPubKey(const CKey& key, const CPubKey &pubkey) override;
68+
bool GetPubKey(const CKeyID &address, CPubKey& vchPubKeyOut) const override;
69+
bool HaveKey(const CKeyID &address) const override
7070
{
7171
bool result;
7272
{
@@ -75,7 +75,7 @@ class CBasicKeyStore : public CKeyStore
7575
}
7676
return result;
7777
}
78-
void GetKeys(std::set<CKeyID> &setAddress) const
78+
void GetKeys(std::set<CKeyID> &setAddress) const override
7979
{
8080
setAddress.clear();
8181
{
@@ -88,7 +88,7 @@ class CBasicKeyStore : public CKeyStore
8888
}
8989
}
9090
}
91-
bool GetKey(const CKeyID &address, CKey &keyOut) const
91+
bool GetKey(const CKeyID &address, CKey &keyOut) const override
9292
{
9393
{
9494
LOCK(cs_KeyStore);
@@ -101,16 +101,16 @@ class CBasicKeyStore : public CKeyStore
101101
}
102102
return false;
103103
}
104-
virtual bool AddCScript(const CScript& redeemScript);
105-
virtual bool HaveCScript(const CScriptID &hash) const;
106-
virtual bool GetCScript(const CScriptID &hash, CScript& redeemScriptOut) const;
104+
virtual bool AddCScript(const CScript& redeemScript) override;
105+
virtual bool HaveCScript(const CScriptID &hash) const override;
106+
virtual bool GetCScript(const CScriptID &hash, CScript& redeemScriptOut) const override;
107107

108-
virtual bool AddWatchOnly(const CScript &dest);
109-
virtual bool RemoveWatchOnly(const CScript &dest);
110-
virtual bool HaveWatchOnly(const CScript &dest) const;
111-
virtual bool HaveWatchOnly() const;
108+
virtual bool AddWatchOnly(const CScript &dest) override;
109+
virtual bool RemoveWatchOnly(const CScript &dest) override;
110+
virtual bool HaveWatchOnly(const CScript &dest) const override;
111+
virtual bool HaveWatchOnly() const override;
112112

113-
bool GetHDChain(CHDChain& hdChainRet) const;
113+
virtual bool GetHDChain(CHDChain& hdChainRet) const;
114114
};
115115

116116
typedef std::vector<unsigned char, secure_allocator<unsigned char> > CKeyingMaterial;

src/net_processing.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -33,9 +33,9 @@ class PeerLogicValidation : public CValidationInterface {
3333
public:
3434
PeerLogicValidation(CConnman* connmanIn);
3535

36-
virtual void SyncTransaction(const CTransaction& tx, const CBlockIndex* pindex, int nPosInBlock);
37-
virtual void UpdatedBlockTip(const CBlockIndex *pindexNew, const CBlockIndex *pindexFork, bool fInitialDownload);
38-
virtual void BlockChecked(const CBlock& block, const CValidationState& state);
36+
virtual void SyncTransaction(const CTransaction& tx, const CBlockIndex* pindex, int nPosInBlock) override;
37+
virtual void UpdatedBlockTip(const CBlockIndex *pindexNew, const CBlockIndex *pindexFork, bool fInitialDownload) override;
38+
virtual void BlockChecked(const CBlock& block, const CValidationState& state) override;
3939
};
4040

4141
struct CNodeStateStats {

src/qt/rpcconsole.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -127,8 +127,8 @@ class QtRPCTimerInterface: public RPCTimerInterface
127127
{
128128
public:
129129
~QtRPCTimerInterface() {}
130-
const char *Name() { return "Qt"; }
131-
RPCTimerBase* NewTimer(boost::function<void(void)>& func, int64_t millis)
130+
const char *Name() override { return "Qt"; }
131+
RPCTimerBase* NewTimer(boost::function<void(void)>& func, int64_t millis) override
132132
{
133133
return new QtRPCTimerBase(func, millis);
134134
}

src/rpc/mining.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -743,7 +743,7 @@ class submitblock_StateCatcher : public CValidationInterface
743743
submitblock_StateCatcher(const uint256 &hashIn) : hash(hashIn), found(false), state() {}
744744

745745
protected:
746-
virtual void BlockChecked(const CBlock& block, const CValidationState& stateIn) {
746+
virtual void BlockChecked(const CBlock& block, const CValidationState& stateIn) override {
747747
if (block.GetHash() != hash)
748748
return;
749749
found = true;

src/script/interpreter.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -128,9 +128,9 @@ class TransactionSignatureChecker : public BaseSignatureChecker
128128

129129
public:
130130
TransactionSignatureChecker(const CTransaction* txToIn, unsigned int nInIn) : txTo(txToIn), nIn(nInIn) {}
131-
bool CheckSig(const std::vector<unsigned char>& scriptSig, const std::vector<unsigned char>& vchPubKey, const CScript& scriptCode) const;
132-
bool CheckLockTime(const CScriptNum& nLockTime) const;
133-
bool CheckSequence(const CScriptNum& nSequence) const;
131+
bool CheckSig(const std::vector<unsigned char>& scriptSig, const std::vector<unsigned char>& vchPubKey, const CScript& scriptCode) const override;
132+
bool CheckLockTime(const CScriptNum& nLockTime) const override;
133+
bool CheckSequence(const CScriptNum& nSequence) const override;
134134
};
135135

136136
class MutableTransactionSignatureChecker : public TransactionSignatureChecker

src/script/sigcache.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ class CachingTransactionSignatureChecker : public TransactionSignatureChecker
2727
public:
2828
CachingTransactionSignatureChecker(const CTransaction* txToIn, unsigned int nInIn, bool storeIn=true) : TransactionSignatureChecker(txToIn, nInIn), store(storeIn) {}
2929

30-
bool VerifySignature(const std::vector<unsigned char>& vchSig, const CPubKey& vchPubKey, const uint256& sighash) const;
30+
bool VerifySignature(const std::vector<unsigned char>& vchSig, const CPubKey& vchPubKey, const uint256& sighash) const override;
3131
};
3232

3333
void InitSignatureCache();

src/script/sign.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -284,7 +284,7 @@ class DummySignatureChecker : public BaseSignatureChecker
284284
public:
285285
DummySignatureChecker() {}
286286

287-
bool CheckSig(const std::vector<unsigned char>& scriptSig, const std::vector<unsigned char>& vchPubKey, const CScript& scriptCode) const
287+
bool CheckSig(const std::vector<unsigned char>& scriptSig, const std::vector<unsigned char>& vchPubKey, const CScript& scriptCode) const override
288288
{
289289
return true;
290290
}

0 commit comments

Comments
 (0)