diff options
author | Ava Chow <github@achow101.com> | 2023-12-21 18:39:23 -0500 |
---|---|---|
committer | Ava Chow <github@achow101.com> | 2024-03-20 16:15:43 -0400 |
commit | 8e1a475062e62321e58a0624385cc3fa0885aa12 (patch) | |
tree | de0e423e73aa76323430d4ff6279470fa302d1e5 /src/wallet/wallet.h | |
parent | 85b1fb19dd3a3f3c68da1c5e60a6eb911e1119a6 (diff) | |
download | bitcoin-8e1a475062e62321e58a0624385cc3fa0885aa12.tar.xz |
wallet: Be able to retrieve single key from descriptors
Adds CWallet::GetKey which retrieves a single key from the descriptors
stored in the wallet.
Diffstat (limited to 'src/wallet/wallet.h')
-rw-r--r-- | src/wallet/wallet.h | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/src/wallet/wallet.h b/src/wallet/wallet.h index 83425fca6b..f07db175b4 100644 --- a/src/wallet/wallet.h +++ b/src/wallet/wallet.h @@ -1059,6 +1059,10 @@ public: //! Retrieve the xpubs in use by the active descriptors std::set<CExtPubKey> GetActiveHDPubKeys() const EXCLUSIVE_LOCKS_REQUIRED(cs_wallet); + + //! Find the private key for the given key id from the wallet's descriptors, if available + //! Returns nullopt when no descriptor has the key or if the wallet is locked. + std::optional<CKey> GetKey(const CKeyID& keyid) const; }; /** |