Skip to content

Commit 7cecf10

Browse files
committed
Replace LegacyScriptPubKeyMan::IsCrypted with LegacyScriptPubKeyMan::HasEncryptionKeys
1 parent bf64171 commit 7cecf10

File tree

2 files changed

+6
-8
lines changed

2 files changed

+6
-8
lines changed

src/wallet/scriptpubkeyman.cpp

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -549,7 +549,7 @@ bool LegacyScriptPubKeyMan::AddKeyPubKeyWithDB(WalletBatch& batch, const CKey& s
549549
RemoveWatchOnly(script);
550550
}
551551

552-
if (!IsCrypted()) {
552+
if (!m_storage.HasEncryptionKeys()) {
553553
return batch.WriteKey(pubkey,
554554
secret.GetPrivKey(),
555555
mapKeyMetadata[pubkey.GetID()]);
@@ -590,7 +590,7 @@ void LegacyScriptPubKeyMan::LoadScriptMetadata(const CScriptID& script_id, const
590590
bool LegacyScriptPubKeyMan::AddKeyPubKeyInner(const CKey& key, const CPubKey &pubkey)
591591
{
592592
LOCK(cs_KeyStore);
593-
if (!IsCrypted()) {
593+
if (!m_storage.HasEncryptionKeys()) {
594594
return FillableSigningProvider::AddKeyPubKey(key, pubkey);
595595
}
596596

@@ -745,7 +745,7 @@ void LegacyScriptPubKeyMan::SetHDChain(const CHDChain& chain, bool memonly)
745745
bool LegacyScriptPubKeyMan::HaveKey(const CKeyID &address) const
746746
{
747747
LOCK(cs_KeyStore);
748-
if (!IsCrypted()) {
748+
if (!m_storage.HasEncryptionKeys()) {
749749
return FillableSigningProvider::HaveKey(address);
750750
}
751751
return mapCryptedKeys.count(address) > 0;
@@ -754,7 +754,7 @@ bool LegacyScriptPubKeyMan::HaveKey(const CKeyID &address) const
754754
bool LegacyScriptPubKeyMan::GetKey(const CKeyID &address, CKey& keyOut) const
755755
{
756756
LOCK(cs_KeyStore);
757-
if (!IsCrypted()) {
757+
if (!m_storage.HasEncryptionKeys()) {
758758
return FillableSigningProvider::GetKey(address, keyOut);
759759
}
760760

@@ -801,7 +801,7 @@ bool LegacyScriptPubKeyMan::GetWatchPubKey(const CKeyID &address, CPubKey &pubke
801801
bool LegacyScriptPubKeyMan::GetPubKey(const CKeyID &address, CPubKey& vchPubKeyOut) const
802802
{
803803
LOCK(cs_KeyStore);
804-
if (!IsCrypted()) {
804+
if (!m_storage.HasEncryptionKeys()) {
805805
if (!FillableSigningProvider::GetPubKey(address, vchPubKeyOut)) {
806806
return GetWatchPubKey(address, vchPubKeyOut);
807807
}
@@ -1387,7 +1387,7 @@ bool LegacyScriptPubKeyMan::ImportScriptPubKeys(const std::set<CScript>& script_
13871387
std::set<CKeyID> LegacyScriptPubKeyMan::GetKeys() const
13881388
{
13891389
LOCK(cs_KeyStore);
1390-
if (!IsCrypted()) {
1390+
if (!m_storage.HasEncryptionKeys()) {
13911391
return FillableSigningProvider::GetKeys();
13921392
}
13931393
std::set<CKeyID> set_address;
@@ -1403,7 +1403,6 @@ LegacyScriptPubKeyMan::LegacyScriptPubKeyMan(CWallet& wallet)
14031403
m_wallet(wallet),
14041404
cs_wallet(wallet.cs_wallet) {}
14051405

1406-
bool LegacyScriptPubKeyMan::IsCrypted() const { return m_wallet.IsCrypted(); }
14071406
void LegacyScriptPubKeyMan::NotifyWatchonlyChanged(bool fHaveWatchOnly) const { return m_wallet.NotifyWatchonlyChanged(fHaveWatchOnly); }
14081407
void LegacyScriptPubKeyMan::NotifyCanGetAddressesChanged() const { return m_wallet.NotifyCanGetAddressesChanged(); }
14091408
template<typename... Params> void LegacyScriptPubKeyMan::WalletLogPrintf(const std::string& fmt, const Params&... parameters) const { return m_wallet.WalletLogPrintf(fmt, parameters...); }

src/wallet/scriptpubkeyman.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -412,7 +412,6 @@ class LegacyScriptPubKeyMan : public ScriptPubKeyMan, public FillableSigningProv
412412
friend class CWallet;
413413
friend class ReserveDestination;
414414
LegacyScriptPubKeyMan(CWallet& wallet);
415-
bool IsCrypted() const;
416415
void NotifyWatchonlyChanged(bool fHaveWatchOnly) const;
417416
void NotifyCanGetAddressesChanged() const;
418417
template<typename... Params> void WalletLogPrintf(const std::string& fmt, const Params&... parameters) const;

0 commit comments

Comments
 (0)