From f6bc2c13c2eb7742bed803bc2c8e86de1f24c844 Mon Sep 17 00:00:00 2001 From: gladcow Date: Thu, 15 Feb 2018 10:29:15 +0300 Subject: [PATCH] Use `override` keyword for overriden class member functions (#1644) * Use `override` keyword for all overriden functions * more override --- src/dsnotificationinterface.h | 2 +- src/httprpc.cpp | 4 ++-- src/httpserver.cpp | 2 +- src/keystore.h | 26 +++++++++++++------------- src/net_processing.h | 6 +++--- src/qt/coincontroltreewidget.h | 2 +- src/qt/receivecoinsdialog.h | 4 ++-- src/qt/receiverequestdialog.h | 4 ++-- src/qt/rpcconsole.cpp | 4 ++-- src/qt/transactionview.h | 2 +- src/rpc/mining.cpp | 2 +- src/script/interpreter.h | 6 +++--- src/script/sigcache.h | 2 +- src/script/sign.cpp | 2 +- src/script/sign.h | 8 ++++---- src/test/addrman_tests.cpp | 2 +- src/test/net_tests.cpp | 4 ++-- src/test/versionbits_tests.cpp | 10 +++++----- src/txdb.h | 11 ++++++----- src/validation.cpp | 10 +++++----- src/validationinterface.h | 6 +++--- src/versionbits.cpp | 10 +++++----- src/wallet/crypter.h | 12 ++++++------ src/wallet/wallet.h | 3 ++- src/zmq/zmqnotificationinterface.h | 6 +++--- src/zmq/zmqpublishnotifier.h | 16 ++++++++-------- 26 files changed, 84 insertions(+), 82 deletions(-) diff --git a/src/dsnotificationinterface.h b/src/dsnotificationinterface.h index 9e96c9afe96b6..8e7df34a33091 100644 --- a/src/dsnotificationinterface.h +++ b/src/dsnotificationinterface.h @@ -21,7 +21,7 @@ class CDSNotificationInterface : public CValidationInterface void AcceptedBlockHeader(const CBlockIndex *pindexNew) override; void NotifyHeaderTip(const CBlockIndex *pindexNew, bool fInitialDownload) override; void UpdatedBlockTip(const CBlockIndex *pindexNew, const CBlockIndex *pindexFork, bool fInitialDownload) override; - void SyncTransaction(const CTransaction &tx, const CBlockIndex *pindex, int posInBlock); + void SyncTransaction(const CTransaction &tx, const CBlockIndex *pindex, int posInBlock) override; private: CConnman& connman; diff --git a/src/httprpc.cpp b/src/httprpc.cpp index fe6dfd6afc87e..bd59cc1a62e4f 100644 --- a/src/httprpc.cpp +++ b/src/httprpc.cpp @@ -48,11 +48,11 @@ class HTTPRPCTimerInterface : public RPCTimerInterface HTTPRPCTimerInterface(struct event_base* _base) : base(_base) { } - const char* Name() + const char* Name() override { return "HTTP"; } - RPCTimerBase* NewTimer(boost::function& func, int64_t millis) + RPCTimerBase* NewTimer(boost::function& func, int64_t millis) override { return new HTTPRPCTimer(base, func, millis); } diff --git a/src/httpserver.cpp b/src/httpserver.cpp index 70a4b0e76637a..4aa4eae2b1a7e 100644 --- a/src/httpserver.cpp +++ b/src/httpserver.cpp @@ -46,7 +46,7 @@ class HTTPWorkItem : public HTTPClosure req(std::move(_req)), path(_path), func(_func) { } - void operator()() + void operator()() override { func(req.get(), path); } diff --git a/src/keystore.h b/src/keystore.h index ed103659ecfe5..e81e376cfa1b7 100644 --- a/src/keystore.h +++ b/src/keystore.h @@ -64,9 +64,9 @@ class CBasicKeyStore : public CKeyStore CHDChain hdChain; public: - bool AddKeyPubKey(const CKey& key, const CPubKey &pubkey); - bool GetPubKey(const CKeyID &address, CPubKey& vchPubKeyOut) const; - bool HaveKey(const CKeyID &address) const + bool AddKeyPubKey(const CKey& key, const CPubKey &pubkey) override; + bool GetPubKey(const CKeyID &address, CPubKey& vchPubKeyOut) const override; + bool HaveKey(const CKeyID &address) const override { bool result; { @@ -75,7 +75,7 @@ class CBasicKeyStore : public CKeyStore } return result; } - void GetKeys(std::set &setAddress) const + void GetKeys(std::set &setAddress) const override { setAddress.clear(); { @@ -88,7 +88,7 @@ class CBasicKeyStore : public CKeyStore } } } - bool GetKey(const CKeyID &address, CKey &keyOut) const + bool GetKey(const CKeyID &address, CKey &keyOut) const override { { LOCK(cs_KeyStore); @@ -101,16 +101,16 @@ class CBasicKeyStore : public CKeyStore } return false; } - virtual bool AddCScript(const CScript& redeemScript); - virtual bool HaveCScript(const CScriptID &hash) const; - virtual bool GetCScript(const CScriptID &hash, CScript& redeemScriptOut) const; + virtual bool AddCScript(const CScript& redeemScript) override; + virtual bool HaveCScript(const CScriptID &hash) const override; + virtual bool GetCScript(const CScriptID &hash, CScript& redeemScriptOut) const override; - virtual bool AddWatchOnly(const CScript &dest); - virtual bool RemoveWatchOnly(const CScript &dest); - virtual bool HaveWatchOnly(const CScript &dest) const; - virtual bool HaveWatchOnly() const; + virtual bool AddWatchOnly(const CScript &dest) override; + virtual bool RemoveWatchOnly(const CScript &dest) override; + virtual bool HaveWatchOnly(const CScript &dest) const override; + virtual bool HaveWatchOnly() const override; - bool GetHDChain(CHDChain& hdChainRet) const; + virtual bool GetHDChain(CHDChain& hdChainRet) const; }; typedef std::vector > CKeyingMaterial; diff --git a/src/net_processing.h b/src/net_processing.h index 66bcbabde3420..aea751fa0c80e 100644 --- a/src/net_processing.h +++ b/src/net_processing.h @@ -34,9 +34,9 @@ class PeerLogicValidation : public CValidationInterface { PeerLogicValidation(CConnman* connmanIn); virtual ~PeerLogicValidation() = default; - virtual void SyncTransaction(const CTransaction& tx, const CBlockIndex* pindex, int nPosInBlock); - virtual void UpdatedBlockTip(const CBlockIndex *pindexNew, const CBlockIndex *pindexFork, bool fInitialDownload); - virtual void BlockChecked(const CBlock& block, const CValidationState& state); + virtual void SyncTransaction(const CTransaction& tx, const CBlockIndex* pindex, int nPosInBlock) override; + virtual void UpdatedBlockTip(const CBlockIndex *pindexNew, const CBlockIndex *pindexFork, bool fInitialDownload) override; + virtual void BlockChecked(const CBlock& block, const CValidationState& state) override; }; struct CNodeStateStats { diff --git a/src/qt/coincontroltreewidget.h b/src/qt/coincontroltreewidget.h index 62645fcdb0747..09059f9934161 100644 --- a/src/qt/coincontroltreewidget.h +++ b/src/qt/coincontroltreewidget.h @@ -16,7 +16,7 @@ class CoinControlTreeWidget : public QTreeWidget explicit CoinControlTreeWidget(QWidget *parent = 0); protected: - virtual void keyPressEvent(QKeyEvent *event); + virtual void keyPressEvent(QKeyEvent *event) override; }; #endif // BITCOIN_QT_COINCONTROLTREEWIDGET_H diff --git a/src/qt/receivecoinsdialog.h b/src/qt/receivecoinsdialog.h index d137f1616e796..0520eb4b36e3e 100644 --- a/src/qt/receivecoinsdialog.h +++ b/src/qt/receivecoinsdialog.h @@ -51,7 +51,7 @@ public Q_SLOTS: void accept(); protected: - virtual void keyPressEvent(QKeyEvent *event); + virtual void keyPressEvent(QKeyEvent *event) override; private: Ui::ReceiveCoinsDialog *ui; @@ -62,7 +62,7 @@ public Q_SLOTS: QModelIndex selectedRow(); void copyColumnToClipboard(int column); - virtual void resizeEvent(QResizeEvent *event); + virtual void resizeEvent(QResizeEvent *event) override; private Q_SLOTS: void on_receiveButton_clicked(); diff --git a/src/qt/receiverequestdialog.h b/src/qt/receiverequestdialog.h index 676745a858f6c..aef30732cd7c8 100644 --- a/src/qt/receiverequestdialog.h +++ b/src/qt/receiverequestdialog.h @@ -38,8 +38,8 @@ public Q_SLOTS: void copyImage(); protected: - virtual void mousePressEvent(QMouseEvent *event); - virtual void contextMenuEvent(QContextMenuEvent *event); + virtual void mousePressEvent(QMouseEvent *event) override; + virtual void contextMenuEvent(QContextMenuEvent *event) override; private: QMenu *contextMenu; diff --git a/src/qt/rpcconsole.cpp b/src/qt/rpcconsole.cpp index 2e84721ffd235..9049648fa220b 100644 --- a/src/qt/rpcconsole.cpp +++ b/src/qt/rpcconsole.cpp @@ -127,8 +127,8 @@ class QtRPCTimerInterface: public RPCTimerInterface { public: ~QtRPCTimerInterface() {} - const char *Name() { return "Qt"; } - RPCTimerBase* NewTimer(boost::function& func, int64_t millis) + const char *Name() override { return "Qt"; } + RPCTimerBase* NewTimer(boost::function& func, int64_t millis) override { return new QtRPCTimerBase(func, millis); } diff --git a/src/qt/transactionview.h b/src/qt/transactionview.h index 2a2ad4912fbf5..340f2e191b540 100644 --- a/src/qt/transactionview.h +++ b/src/qt/transactionview.h @@ -81,7 +81,7 @@ class TransactionView : public QWidget GUIUtil::TableViewLastColumnResizingFixer *columnResizingFixer; - virtual void resizeEvent(QResizeEvent* event); + virtual void resizeEvent(QResizeEvent* event) override; bool eventFilter(QObject *obj, QEvent *event); diff --git a/src/rpc/mining.cpp b/src/rpc/mining.cpp index 499c8ac2b53fb..d6c235faa9a36 100644 --- a/src/rpc/mining.cpp +++ b/src/rpc/mining.cpp @@ -760,7 +760,7 @@ class submitblock_StateCatcher : public CValidationInterface submitblock_StateCatcher(const uint256 &hashIn) : hash(hashIn), found(false), state() {} protected: - virtual void BlockChecked(const CBlock& block, const CValidationState& stateIn) { + virtual void BlockChecked(const CBlock& block, const CValidationState& stateIn) override { if (block.GetHash() != hash) return; found = true; diff --git a/src/script/interpreter.h b/src/script/interpreter.h index 6de9048781b85..801e23b361d2f 100644 --- a/src/script/interpreter.h +++ b/src/script/interpreter.h @@ -128,9 +128,9 @@ class TransactionSignatureChecker : public BaseSignatureChecker public: TransactionSignatureChecker(const CTransaction* txToIn, unsigned int nInIn) : txTo(txToIn), nIn(nInIn) {} - bool CheckSig(const std::vector& scriptSig, const std::vector& vchPubKey, const CScript& scriptCode) const; - bool CheckLockTime(const CScriptNum& nLockTime) const; - bool CheckSequence(const CScriptNum& nSequence) const; + bool CheckSig(const std::vector& scriptSig, const std::vector& vchPubKey, const CScript& scriptCode) const override; + bool CheckLockTime(const CScriptNum& nLockTime) const override; + bool CheckSequence(const CScriptNum& nSequence) const override; }; class MutableTransactionSignatureChecker : public TransactionSignatureChecker diff --git a/src/script/sigcache.h b/src/script/sigcache.h index 9cd3ea3948a03..15ee161deffea 100644 --- a/src/script/sigcache.h +++ b/src/script/sigcache.h @@ -27,7 +27,7 @@ class CachingTransactionSignatureChecker : public TransactionSignatureChecker public: CachingTransactionSignatureChecker(const CTransaction* txToIn, unsigned int nInIn, bool storeIn=true) : TransactionSignatureChecker(txToIn, nInIn), store(storeIn) {} - bool VerifySignature(const std::vector& vchSig, const CPubKey& vchPubKey, const uint256& sighash) const; + bool VerifySignature(const std::vector& vchSig, const CPubKey& vchPubKey, const uint256& sighash) const override; }; void InitSignatureCache(); diff --git a/src/script/sign.cpp b/src/script/sign.cpp index 2f4111f786420..951c1bc1e607f 100644 --- a/src/script/sign.cpp +++ b/src/script/sign.cpp @@ -284,7 +284,7 @@ class DummySignatureChecker : public BaseSignatureChecker public: DummySignatureChecker() {} - bool CheckSig(const std::vector& scriptSig, const std::vector& vchPubKey, const CScript& scriptCode) const + bool CheckSig(const std::vector& scriptSig, const std::vector& vchPubKey, const CScript& scriptCode) const override { return true; } diff --git a/src/script/sign.h b/src/script/sign.h index b86423d52df5e..ee8f55180782d 100644 --- a/src/script/sign.h +++ b/src/script/sign.h @@ -39,16 +39,16 @@ class TransactionSignatureCreator : public BaseSignatureCreator { public: TransactionSignatureCreator(const CKeyStore* keystoreIn, const CTransaction* txToIn, unsigned int nInIn, int nHashTypeIn=SIGHASH_ALL); - const BaseSignatureChecker& Checker() const { return checker; } - bool CreateSig(std::vector& vchSig, const CKeyID& keyid, const CScript& scriptCode) const; + const BaseSignatureChecker& Checker() const override{ return checker; } + bool CreateSig(std::vector& vchSig, const CKeyID& keyid, const CScript& scriptCode) const override; }; /** A signature creator that just produces 72-byte empty signatures. */ class DummySignatureCreator : public BaseSignatureCreator { public: DummySignatureCreator(const CKeyStore* keystoreIn) : BaseSignatureCreator(keystoreIn) {} - const BaseSignatureChecker& Checker() const; - bool CreateSig(std::vector& vchSig, const CKeyID& keyid, const CScript& scriptCode) const; + const BaseSignatureChecker& Checker() const override; + bool CreateSig(std::vector& vchSig, const CKeyID& keyid, const CScript& scriptCode) const override; }; /** Produce a script signature using a generic signature creator. */ diff --git a/src/test/addrman_tests.cpp b/src/test/addrman_tests.cpp index 291e28f649164..ef847a1f3e0e8 100644 --- a/src/test/addrman_tests.cpp +++ b/src/test/addrman_tests.cpp @@ -27,7 +27,7 @@ class CAddrManTest : public CAddrMan insecure_rand = FastRandomContext(true); } - int RandomInt(int nMax) + int RandomInt(int nMax) override { state = (CHashWriter(SER_GETHASH, 0) << state).GetHash().GetCheapHash(); return (unsigned int)(state % nMax); diff --git a/src/test/net_tests.cpp b/src/test/net_tests.cpp index 74edf91efb180..893e7bdbe6064 100644 --- a/src/test/net_tests.cpp +++ b/src/test/net_tests.cpp @@ -28,7 +28,7 @@ class CAddrManSerializationMock : public CAddrMan class CAddrManUncorrupted : public CAddrManSerializationMock { public: - void Serialize(CDataStream& s) const + void Serialize(CDataStream& s) const override { CAddrMan::Serialize(s); } @@ -37,7 +37,7 @@ class CAddrManUncorrupted : public CAddrManSerializationMock class CAddrManCorrupted : public CAddrManSerializationMock { public: - void Serialize(CDataStream& s) const + void Serialize(CDataStream& s) const override { // Produces corrupt output that claims addrman has 20 addrs when it only has one addr. unsigned char nVersion = 1; diff --git a/src/test/versionbits_tests.cpp b/src/test/versionbits_tests.cpp index 85c98110d48c4..79418f0247b70 100644 --- a/src/test/versionbits_tests.cpp +++ b/src/test/versionbits_tests.cpp @@ -23,11 +23,11 @@ class TestConditionChecker : public AbstractThresholdConditionChecker mutable ThresholdConditionCache cache; public: - int64_t BeginTime(const Consensus::Params& params) const { return TestTime(10000); } - int64_t EndTime(const Consensus::Params& params) const { return TestTime(20000); } - int Period(const Consensus::Params& params) const { return 1000; } - int Threshold(const Consensus::Params& params) const { return 900; } - bool Condition(const CBlockIndex* pindex, const Consensus::Params& params) const { return (pindex->nVersion & 0x100); } + int64_t BeginTime(const Consensus::Params& params) const override { return TestTime(10000); } + int64_t EndTime(const Consensus::Params& params) const override { return TestTime(20000); } + int Period(const Consensus::Params& params) const override { return 1000; } + int Threshold(const Consensus::Params& params) const override { return 900; } + bool Condition(const CBlockIndex* pindex, const Consensus::Params& params) const override { return (pindex->nVersion & 0x100); } ThresholdState GetStateFor(const CBlockIndex* pindexPrev) const { return AbstractThresholdConditionChecker::GetStateFor(pindexPrev, paramsDummy, cache); } int GetStateSinceHeightFor(const CBlockIndex* pindexPrev) const { return AbstractThresholdConditionChecker::GetStateSinceHeightFor(pindexPrev, paramsDummy, cache); } diff --git a/src/txdb.h b/src/txdb.h index c709fd0ca8bf4..9e7c5b699d0b1 100644 --- a/src/txdb.h +++ b/src/txdb.h @@ -74,6 +74,7 @@ class CCoinsViewDB : public CCoinsView public: CCoinsViewDB(size_t nCacheSize, bool fMemory = false, bool fWipe = false); + bool GetCoin(const COutPoint &outpoint, Coin &coin) const override; bool HaveCoin(const COutPoint &outpoint) const override; uint256 GetBestBlock() const override; @@ -91,12 +92,12 @@ class CCoinsViewDBCursor: public CCoinsViewCursor public: ~CCoinsViewDBCursor() {} - bool GetKey(COutPoint &key) const; - bool GetValue(Coin &coin) const; - unsigned int GetValueSize() const; + bool GetKey(COutPoint &key) const override; + bool GetValue(Coin &coin) const override; + unsigned int GetValueSize() const override; - bool Valid() const; - void Next(); + bool Valid() const override; + void Next() override; private: CCoinsViewDBCursor(CDBIterator* pcursorIn, const uint256 &hashBlockIn): diff --git a/src/validation.cpp b/src/validation.cpp index 0581a50f2a61d..2f293b5b31ebd 100644 --- a/src/validation.cpp +++ b/src/validation.cpp @@ -1944,12 +1944,12 @@ class WarningBitsConditionChecker : public AbstractThresholdConditionChecker public: WarningBitsConditionChecker(int bitIn) : bit(bitIn) {} - int64_t BeginTime(const Consensus::Params& params) const { return 0; } - int64_t EndTime(const Consensus::Params& params) const { return std::numeric_limits::max(); } - int Period(const Consensus::Params& params) const { return params.nMinerConfirmationWindow; } - int Threshold(const Consensus::Params& params) const { return params.nRuleChangeActivationThreshold; } + int64_t BeginTime(const Consensus::Params& params) const override { return 0; } + int64_t EndTime(const Consensus::Params& params) const override { return std::numeric_limits::max(); } + int Period(const Consensus::Params& params) const override { return params.nMinerConfirmationWindow; } + int Threshold(const Consensus::Params& params) const override { return params.nRuleChangeActivationThreshold; } - bool Condition(const CBlockIndex* pindex, const Consensus::Params& params) const + bool Condition(const CBlockIndex* pindex, const Consensus::Params& params) const override { return ((pindex->nVersion & VERSIONBITS_TOP_MASK) == VERSIONBITS_TOP_BITS) && ((pindex->nVersion >> bit) & 1) != 0 && diff --git a/src/validationinterface.h b/src/validationinterface.h index 360e4005c2405..46820cd320a39 100644 --- a/src/validationinterface.h +++ b/src/validationinterface.h @@ -42,9 +42,9 @@ class CValidationInterface { virtual void Inventory(const uint256 &hash) {} virtual void ResendWalletTransactions(int64_t nBestBlockTime, CConnman* connman) {} virtual void BlockChecked(const CBlock&, const CValidationState&) {} - virtual void GetScriptForMining(boost::shared_ptr&) {}; - virtual void ResetRequestCount(const uint256 &hash) {}; - virtual void NewPoWValidBlock(const CBlockIndex *pindex, const std::shared_ptr& block) {}; + virtual void GetScriptForMining(boost::shared_ptr&) {} + virtual void ResetRequestCount(const uint256 &hash) {} + virtual void NewPoWValidBlock(const CBlockIndex *pindex, const std::shared_ptr& block) {} friend void ::RegisterValidationInterface(CValidationInterface*); friend void ::UnregisterValidationInterface(CValidationInterface*); friend void ::UnregisterAllValidationInterfaces(); diff --git a/src/versionbits.cpp b/src/versionbits.cpp index fbbcdb4278239..af37b6350ae30 100644 --- a/src/versionbits.cpp +++ b/src/versionbits.cpp @@ -153,12 +153,12 @@ class VersionBitsConditionChecker : public AbstractThresholdConditionChecker { const Consensus::DeploymentPos id; protected: - int64_t BeginTime(const Consensus::Params& params) const { return params.vDeployments[id].nStartTime; } - int64_t EndTime(const Consensus::Params& params) const { return params.vDeployments[id].nTimeout; } - int Period(const Consensus::Params& params) const { return params.vDeployments[id].nWindowSize ? params.vDeployments[id].nWindowSize : params.nMinerConfirmationWindow; } - int Threshold(const Consensus::Params& params) const { return params.vDeployments[id].nThreshold ? params.vDeployments[id].nThreshold : params.nRuleChangeActivationThreshold; } + int64_t BeginTime(const Consensus::Params& params) const override { return params.vDeployments[id].nStartTime; } + int64_t EndTime(const Consensus::Params& params) const override { return params.vDeployments[id].nTimeout; } + int Period(const Consensus::Params& params) const override { return params.vDeployments[id].nWindowSize ? params.vDeployments[id].nWindowSize : params.nMinerConfirmationWindow; } + int Threshold(const Consensus::Params& params) const override { return params.vDeployments[id].nThreshold ? params.vDeployments[id].nThreshold : params.nRuleChangeActivationThreshold; } - bool Condition(const CBlockIndex* pindex, const Consensus::Params& params) const + bool Condition(const CBlockIndex* pindex, const Consensus::Params& params) const override { return (((pindex->nVersion & VERSIONBITS_TOP_MASK) == VERSIONBITS_TOP_BITS) && (pindex->nVersion & Mask(params)) != 0); } diff --git a/src/wallet/crypter.h b/src/wallet/crypter.h index 3e12e4b3ffd72..1b5cdbcffcb82 100644 --- a/src/wallet/crypter.h +++ b/src/wallet/crypter.h @@ -189,8 +189,8 @@ class CCryptoKeyStore : public CBasicKeyStore bool Lock(bool fAllowMixing = false); virtual bool AddCryptedKey(const CPubKey &vchPubKey, const std::vector &vchCryptedSecret); - bool AddKeyPubKey(const CKey& key, const CPubKey &pubkey); - bool HaveKey(const CKeyID &address) const + bool AddKeyPubKey(const CKey& key, const CPubKey &pubkey) override; + bool HaveKey(const CKeyID &address) const override { { LOCK(cs_KeyStore); @@ -200,9 +200,9 @@ class CCryptoKeyStore : public CBasicKeyStore } return false; } - bool GetKey(const CKeyID &address, CKey& keyOut) const; - bool GetPubKey(const CKeyID &address, CPubKey& vchPubKeyOut) const; - void GetKeys(std::set &setAddress) const + bool GetKey(const CKeyID &address, CKey& keyOut) const override; + bool GetPubKey(const CKeyID &address, CPubKey& vchPubKeyOut) const override; + void GetKeys(std::set &setAddress) const override { if (!IsCrypted()) { @@ -218,7 +218,7 @@ class CCryptoKeyStore : public CBasicKeyStore } } - bool GetHDChain(CHDChain& hdChainRet) const; + virtual bool GetHDChain(CHDChain& hdChainRet) const override; /** * Wallet status (encrypted, locked) changed. diff --git a/src/wallet/wallet.h b/src/wallet/wallet.h index af4f1107af73f..57ede80f70abb 100644 --- a/src/wallet/wallet.h +++ b/src/wallet/wallet.h @@ -877,6 +877,7 @@ class CWallet : public CCryptoKeyStore, public CValidationInterface //! Adds a watch-only address to the store, and saves it to disk. bool AddWatchOnly(const CScript& dest, int64_t nCreateTime); + bool RemoveWatchOnly(const CScript &dest) override; //! Adds a watch-only address to the store, without saving it to disk (used by LoadWallet) bool LoadWatchOnly(const CScript &dest); @@ -1142,7 +1143,7 @@ class CReserveKey : public CReserveScript void ReturnKey(); bool GetReservedKey(CPubKey &pubkey, bool fInternalIn /*= false*/); void KeepKey(); - void KeepScript() { KeepKey(); } + void KeepScript() override { KeepKey(); } }; diff --git a/src/zmq/zmqnotificationinterface.h b/src/zmq/zmqnotificationinterface.h index 44bd8b1c80fc2..13b5c8bf96ed0 100644 --- a/src/zmq/zmqnotificationinterface.h +++ b/src/zmq/zmqnotificationinterface.h @@ -24,9 +24,9 @@ class CZMQNotificationInterface : public CValidationInterface void Shutdown(); // CValidationInterface - void SyncTransaction(const CTransaction& tx, const CBlockIndex *pindex, int posInBlock); - void UpdatedBlockTip(const CBlockIndex *pindexNew, const CBlockIndex *pindexFork, bool fInitialDownload); - void NotifyTransactionLock(const CTransaction &tx); + void SyncTransaction(const CTransaction& tx, const CBlockIndex *pindex, int posInBlock) override; + void UpdatedBlockTip(const CBlockIndex *pindexNew, const CBlockIndex *pindexFork, bool fInitialDownload) override; + void NotifyTransactionLock(const CTransaction &tx) override; private: CZMQNotificationInterface(); diff --git a/src/zmq/zmqpublishnotifier.h b/src/zmq/zmqpublishnotifier.h index 09a7793bc6bc4..4ade12cdceac3 100644 --- a/src/zmq/zmqpublishnotifier.h +++ b/src/zmq/zmqpublishnotifier.h @@ -24,44 +24,44 @@ class CZMQAbstractPublishNotifier : public CZMQAbstractNotifier */ bool SendMessage(const char *command, const void* data, size_t size); - bool Initialize(void *pcontext); - void Shutdown(); + bool Initialize(void *pcontext) override; + void Shutdown() override; }; class CZMQPublishHashBlockNotifier : public CZMQAbstractPublishNotifier { public: - bool NotifyBlock(const CBlockIndex *pindex); + bool NotifyBlock(const CBlockIndex *pindex) override; }; class CZMQPublishHashTransactionNotifier : public CZMQAbstractPublishNotifier { public: - bool NotifyTransaction(const CTransaction &transaction); + bool NotifyTransaction(const CTransaction &transaction) override; }; class CZMQPublishHashTransactionLockNotifier : public CZMQAbstractPublishNotifier { public: - bool NotifyTransactionLock(const CTransaction &transaction); + bool NotifyTransactionLock(const CTransaction &transaction) override; }; class CZMQPublishRawBlockNotifier : public CZMQAbstractPublishNotifier { public: - bool NotifyBlock(const CBlockIndex *pindex); + bool NotifyBlock(const CBlockIndex *pindex) override; }; class CZMQPublishRawTransactionNotifier : public CZMQAbstractPublishNotifier { public: - bool NotifyTransaction(const CTransaction &transaction); + bool NotifyTransaction(const CTransaction &transaction) override; }; class CZMQPublishRawTransactionLockNotifier : public CZMQAbstractPublishNotifier { public: - bool NotifyTransactionLock(const CTransaction &transaction); + bool NotifyTransactionLock(const CTransaction &transaction) override; }; #endif // BITCOIN_ZMQ_ZMQPUBLISHNOTIFIER_H