Skip to content

Commit ddc9355

Browse files
committed
wallet: make CanGenerateKeys() const
This method simply checks if HD is or can be enabled and does not require mutability.
1 parent dc2d065 commit ddc9355

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

src/wallet/scriptpubkeyman.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -973,7 +973,7 @@ void LegacyScriptPubKeyMan::LoadKeyPool(int64_t nIndex, const CKeyPool &keypool)
973973
mapKeyMetadata[keyid] = CKeyMetadata(keypool.nTime);
974974
}
975975

976-
bool LegacyScriptPubKeyMan::CanGenerateKeys()
976+
bool LegacyScriptPubKeyMan::CanGenerateKeys() const
977977
{
978978
// A wallet can generate keys if it has an HD seed (IsHDEnabled) or it is a non-HD wallet (pre FEATURE_HD)
979979
LOCK(cs_KeyStore);

src/wallet/scriptpubkeyman.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -410,7 +410,7 @@ class LegacyScriptPubKeyMan : public ScriptPubKeyMan, public FillableSigningProv
410410
bool ImportScriptPubKeys(const std::set<CScript>& script_pub_keys, const bool have_solving_data, const int64_t timestamp) EXCLUSIVE_LOCKS_REQUIRED(cs_KeyStore);
411411

412412
/* Returns true if the wallet can generate new keys */
413-
bool CanGenerateKeys();
413+
bool CanGenerateKeys() const;
414414

415415
/* Generates a new HD seed (will not be activated) */
416416
CPubKey GenerateNewSeed();

0 commit comments

Comments
 (0)