Skip to content

Commit 6c5427d

Browse files
committed
wallet: Prevent "overrides a member function but is not marked 'override'" warnings
Because it is used inconsistently at least version 5.4.0 of g++ to complains about methods that don't use override. There is two ways to go about this: remove override from the methods having it, or add it to the methods missing it. I chose the second.
1 parent d8e8b06 commit 6c5427d

File tree

1 file changed

+11
-11
lines changed

1 file changed

+11
-11
lines changed

src/wallet/wallet.h

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -737,7 +737,7 @@ class CWallet : public CCryptoKeyStore, public CValidationInterface
737737
CPubKey GenerateNewKey();
738738
void DeriveNewChildKey(CKeyMetadata& metadata, CKey& secret);
739739
//! Adds a key to the store, and saves it to disk.
740-
bool AddKeyPubKey(const CKey& key, const CPubKey &pubkey);
740+
bool AddKeyPubKey(const CKey& key, const CPubKey &pubkey) override;
741741
//! Adds a key to the store, without saving it to disk (used by LoadWallet)
742742
bool LoadKey(const CKey& key, const CPubKey &pubkey) { return CCryptoKeyStore::AddKeyPubKey(key, pubkey); }
743743
//! Load metadata (used by LoadWallet)
@@ -747,10 +747,10 @@ class CWallet : public CCryptoKeyStore, public CValidationInterface
747747
void UpdateTimeFirstKey(int64_t nCreateTime);
748748

749749
//! Adds an encrypted key to the store, and saves it to disk.
750-
bool AddCryptedKey(const CPubKey &vchPubKey, const std::vector<unsigned char> &vchCryptedSecret);
750+
bool AddCryptedKey(const CPubKey &vchPubKey, const std::vector<unsigned char> &vchCryptedSecret) override;
751751
//! Adds an encrypted key to the store, without saving it to disk (used by LoadWallet)
752752
bool LoadCryptedKey(const CPubKey &vchPubKey, const std::vector<unsigned char> &vchCryptedSecret);
753-
bool AddCScript(const CScript& redeemScript);
753+
bool AddCScript(const CScript& redeemScript) override;
754754
bool LoadCScript(const CScript& redeemScript);
755755

756756
//! Adds a destination data tuple to the store, and saves it to disk
@@ -764,7 +764,7 @@ class CWallet : public CCryptoKeyStore, public CValidationInterface
764764

765765
//! Adds a watch-only address to the store, and saves it to disk.
766766
bool AddWatchOnly(const CScript& dest, int64_t nCreateTime);
767-
bool RemoveWatchOnly(const CScript &dest);
767+
bool RemoveWatchOnly(const CScript &dest) override;
768768
//! Adds a watch-only address to the store, without saving it to disk (used by LoadWallet)
769769
bool LoadWatchOnly(const CScript &dest);
770770

@@ -786,11 +786,11 @@ class CWallet : public CCryptoKeyStore, public CValidationInterface
786786
void MarkDirty();
787787
bool AddToWallet(const CWalletTx& wtxIn, bool fFlushOnClose=true);
788788
bool LoadToWallet(const CWalletTx& wtxIn);
789-
void SyncTransaction(const CTransaction& tx, const CBlockIndex *pindex, int posInBlock);
789+
void SyncTransaction(const CTransaction& tx, const CBlockIndex *pindex, int posInBlock) override;
790790
bool AddToWalletIfInvolvingMe(const CTransaction& tx, const CBlockIndex* pIndex, int posInBlock, bool fUpdate);
791791
int ScanForWalletTransactions(CBlockIndex* pindexStart, bool fUpdate = false);
792792
void ReacceptWalletTransactions();
793-
void ResendWalletTransactions(int64_t nBestBlockTime, CConnman* connman);
793+
void ResendWalletTransactions(int64_t nBestBlockTime, CConnman* connman) override;
794794
std::vector<uint256> ResendWalletTransactionsBefore(int64_t nTime, CConnman* connman);
795795
CAmount GetBalance() const;
796796
CAmount GetUnconfirmedBalance() const;
@@ -872,7 +872,7 @@ class CWallet : public CCryptoKeyStore, public CValidationInterface
872872
bool IsAllFromMe(const CTransaction& tx, const isminefilter& filter) const;
873873
CAmount GetCredit(const CTransaction& tx, const isminefilter& filter) const;
874874
CAmount GetChange(const CTransaction& tx) const;
875-
void SetBestChain(const CBlockLocator& loc);
875+
void SetBestChain(const CBlockLocator& loc) override;
876876

877877
DBErrors LoadWallet(bool& fFirstRunRet);
878878
DBErrors ZapWalletTx(std::vector<CWalletTx>& vWtx);
@@ -882,9 +882,9 @@ class CWallet : public CCryptoKeyStore, public CValidationInterface
882882

883883
bool DelAddressBook(const CTxDestination& address);
884884

885-
void UpdatedTransaction(const uint256 &hashTx);
885+
void UpdatedTransaction(const uint256 &hashTx) override;
886886

887-
void Inventory(const uint256 &hash)
887+
void Inventory(const uint256 &hash) override
888888
{
889889
{
890890
LOCK(cs_wallet);
@@ -894,8 +894,8 @@ class CWallet : public CCryptoKeyStore, public CValidationInterface
894894
}
895895
}
896896

897-
void GetScriptForMining(boost::shared_ptr<CReserveScript> &script);
898-
void ResetRequestCount(const uint256 &hash)
897+
void GetScriptForMining(boost::shared_ptr<CReserveScript> &script) override;
898+
void ResetRequestCount(const uint256 &hash) override
899899
{
900900
LOCK(cs_wallet);
901901
mapRequestCount[hash] = 0;

0 commit comments

Comments
 (0)