mirror of
https://github.com/Retropex/bitcoin.git
synced 2025-05-21 17:42:37 +02:00
Add GetEncryptionKey() and HasEncryptionKeys() to WalletStorage
Adds functions in WalletStorage that allow ScriptPubKeyMans to check and get encryption keys from the wallet.
This commit is contained in:
parent
4ee8a58ce7
commit
fd9d6eebc1
@ -31,6 +31,8 @@ public:
|
|||||||
virtual void UnsetBlankWalletFlag(WalletBatch&) = 0;
|
virtual void UnsetBlankWalletFlag(WalletBatch&) = 0;
|
||||||
virtual bool CanSupportFeature(enum WalletFeature) const = 0;
|
virtual bool CanSupportFeature(enum WalletFeature) const = 0;
|
||||||
virtual void SetMinVersion(enum WalletFeature, WalletBatch* = nullptr, bool = false) = 0;
|
virtual void SetMinVersion(enum WalletFeature, WalletBatch* = nullptr, bool = false) = 0;
|
||||||
|
virtual const CKeyingMaterial& GetEncryptionKey() const = 0;
|
||||||
|
virtual bool HasEncryptionKeys() const = 0;
|
||||||
virtual bool IsLocked() const = 0;
|
virtual bool IsLocked() const = 0;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -4056,3 +4056,13 @@ LegacyScriptPubKeyMan* CWallet::GetLegacyScriptPubKeyMan() const
|
|||||||
{
|
{
|
||||||
return m_spk_man.get();
|
return m_spk_man.get();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const CKeyingMaterial& CWallet::GetEncryptionKey() const
|
||||||
|
{
|
||||||
|
return vMasterKey;
|
||||||
|
}
|
||||||
|
|
||||||
|
bool CWallet::HasEncryptionKeys() const
|
||||||
|
{
|
||||||
|
return !mapMasterKeys.empty();
|
||||||
|
}
|
||||||
|
@ -1136,6 +1136,9 @@ public:
|
|||||||
|
|
||||||
LegacyScriptPubKeyMan* GetLegacyScriptPubKeyMan() const;
|
LegacyScriptPubKeyMan* GetLegacyScriptPubKeyMan() const;
|
||||||
|
|
||||||
|
const CKeyingMaterial& GetEncryptionKey() const override;
|
||||||
|
bool HasEncryptionKeys() const override;
|
||||||
|
|
||||||
// Temporary LegacyScriptPubKeyMan accessors and aliases.
|
// Temporary LegacyScriptPubKeyMan accessors and aliases.
|
||||||
friend class LegacyScriptPubKeyMan;
|
friend class LegacyScriptPubKeyMan;
|
||||||
std::unique_ptr<LegacyScriptPubKeyMan> m_spk_man = MakeUnique<LegacyScriptPubKeyMan>(*this);
|
std::unique_ptr<LegacyScriptPubKeyMan> m_spk_man = MakeUnique<LegacyScriptPubKeyMan>(*this);
|
||||||
|
Loading…
Reference in New Issue
Block a user