Skip to content

Commit e576b13

Browse files
committed
Replace LegacyScriptPubKeyMan::vMasterKey with GetDecryptionKey()
1 parent fd9d6ee commit e576b13

File tree

2 files changed

+2
-4
lines changed

2 files changed

+2
-4
lines changed

src/wallet/scriptpubkeyman.cpp

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -594,7 +594,7 @@ bool LegacyScriptPubKeyMan::AddKeyPubKeyInner(const CKey& key, const CPubKey &pu
594594

595595
std::vector<unsigned char> vchCryptedSecret;
596596
CKeyingMaterial vchSecret(key.begin(), key.end());
597-
if (!EncryptSecret(vMasterKey, vchSecret, pubkey.GetHash(), vchCryptedSecret)) {
597+
if (!EncryptSecret(m_storage.GetEncryptionKey(), vchSecret, pubkey.GetHash(), vchCryptedSecret)) {
598598
return false;
599599
}
600600

@@ -759,7 +759,7 @@ bool LegacyScriptPubKeyMan::GetKey(const CKeyID &address, CKey& keyOut) const
759759
{
760760
const CPubKey &vchPubKey = (*mi).second.first;
761761
const std::vector<unsigned char> &vchCryptedSecret = (*mi).second.second;
762-
return DecryptKey(vMasterKey, vchCryptedSecret, vchPubKey, keyOut);
762+
return DecryptKey(m_storage.GetEncryptionKey(), vchCryptedSecret, vchPubKey, keyOut);
763763
}
764764
return false;
765765
}
@@ -1398,7 +1398,6 @@ LegacyScriptPubKeyMan::LegacyScriptPubKeyMan(CWallet& wallet)
13981398
: ScriptPubKeyMan(wallet),
13991399
m_wallet(wallet),
14001400
cs_wallet(wallet.cs_wallet),
1401-
vMasterKey(wallet.vMasterKey),
14021401
fUseCrypto(wallet.fUseCrypto),
14031402
fDecryptionThoroughlyChecked(wallet.fDecryptionThoroughlyChecked) {}
14041403

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
template<typename... Params> void WalletLogPrintf(const std::string& fmt, const Params&... parameters) const;
413413
CWallet& m_wallet;
414414
CCriticalSection& cs_wallet;
415-
CKeyingMaterial& vMasterKey GUARDED_BY(cs_KeyStore);
416415
std::atomic<bool>& fUseCrypto;
417416
bool& fDecryptionThoroughlyChecked;
418417
};

0 commit comments

Comments
 (0)