5 #ifndef BITCOIN_WALLET_SCRIPTPUBKEYMAN_H 6 #define BITCOIN_WALLET_SCRIPTPUBKEYMAN_H 25 #include <boost/signals2/signal.hpp> 29 #include <unordered_map> 35 class ScriptPubKeyMan;
61 static constexpr int64_t
UNKNOWN_TIME = std::numeric_limits<int64_t>::max();
132 template<
typename Stream>
139 template<
typename Stream>
146 }
catch (std::ios_base::failure&) {
153 }
catch (std::ios_base::failure&) {
164 std::optional<bool>
internal;
197 virtual bool TopUp(
unsigned int size = 0) {
return false; }
253 virtual std::unordered_set<CScript, SaltedSipHasher>
GetScriptPubKeys()
const {
return {}; };
256 template <
typename...
Params>
279 class DescriptorScriptPubKeyMan;
288 using CryptedKeyMap = std::map<CKeyID, std::pair<CPubKey, std::vector<unsigned char>>>;
316 std::unordered_set<CScript, SaltedSipHasher>
GetScriptPubKeys()
const override;
347 bool LoadCryptedKey(
const CPubKey &vchPubKey,
const std::vector<unsigned char> &vchCryptedSecret,
bool checksum_valid);
461 bool TopUp(
unsigned int size = 0)
override;
499 bool AddCryptedKey(
const CPubKey &vchPubKey,
const std::vector<unsigned char> &vchCryptedSecret);
564 std::set<CKeyID>
GetKeys()
const override;
588 using CryptedKeyMap = std::map<CKeyID, std::pair<CPubKey, std::vector<unsigned char>>>;
626 m_keypool_size(keypool_size),
627 m_wallet_descriptor(descriptor)
631 m_keypool_size(keypool_size)
649 bool TopUp(
unsigned int size = 0)
override;
709 std::vector<std::unique_ptr<DescriptorScriptPubKeyMan>>
desc_spkms;
710 std::shared_ptr<CWallet> watchonly_wallet{
nullptr};
711 std::shared_ptr<CWallet> solvable_wallet{
nullptr};
716 #endif // BITCOIN_WALLET_SCRIPTPUBKEYMAN_H int64_t GetTimeFirstKey() const override
virtual std::string GetDisplayName() const =0
bool GetCScript(const CScriptID &scriptid, CScript &script) const override
virtual SigningResult SignMessage(const std::string &message, const PKHash &pkhash, std::string &str_sig) const
Sign a message with the given script.
virtual std::optional< common::PSBTError > FillPSBT(PartiallySignedTransaction &psbt, const PrecomputedTransactionData &txdata, int sighash_type=SIGHASH_DEFAULT, bool sign=true, bool bip32derivs=false, int *n_signed=nullptr, bool finalize=true) const
Adds script and derivation path information to a PSBT, and optionally signs it.
bool ImportPrivKeys(const std::map< CKeyID, CKey > &privkey_map, const int64_t timestamp) EXCLUSIVE_LOCKS_REQUIRED(cs_KeyStore)
static const std::string sighash
bool CheckDecryptionKey(const CKeyingMaterial &master_key) override
Check that the given decryption key is valid for this ScriptPubKeyMan, i.e. it decrypts all of the ke...
void UpdateTimeFirstKey(int64_t nCreateTime) EXCLUSIVE_LOCKS_REQUIRED(cs_KeyStore)
Update wallet first key creation time.
bool AddKeyPubKey(const CKey &key, const CPubKey &pubkey) override
Adds a key to the store, and saves it to disk.
std::optional< CKey > GetKey(const CKeyID &keyid) const EXCLUSIVE_LOCKS_REQUIRED(cs_desc_man)
Retrieve the particular key if it is available. Returns nullopt if the key is not in the wallet...
virtual uint256 GetID() const
bool RemoveWatchOnly(const CScript &dest)
Remove a watch only script from the keystore.
bool GetKey(const CKeyID &address, CKey &key) const override
bool CheckDecryptionKey(const CKeyingMaterial &master_key) override
Check that the given decryption key is valid for this ScriptPubKeyMan, i.e. it decrypts all of the ke...
std::vector< WalletDestination > MarkUnusedAddresses(const CScript &script) override
Mark unused addresses as being used Affects all keys up to and including the one determined by provid...
bool AddCryptedKey(const CPubKey &vchPubKey, const std::vector< unsigned char > &vchCryptedSecret)
Adds an encrypted key to the store, and saves it to disk.
bool SetupDescriptorGeneration(WalletBatch &batch, const CExtKey &master_key, OutputType addr_type, bool internal)
Setup descriptors based on the given CExtkey.
void UpgradeKeyMetadata()
Upgrade stored CKeyMetadata objects to store key origin info as KeyOriginInfo.
bool GetPubKey(const CKeyID &address, CPubKey &vchPubKeyOut) const override
std::vector< WalletDestination > MarkUnusedAddresses(const CScript &script) override
Mark unused addresses as being used Affects all keys up to and including the one determined by provid...
bool Upgrade(int prev_version, int new_version, bilingual_str &error) override
Upgrades the wallet to the specified version.
virtual bool IsWalletFlagSet(uint64_t) const =0
virtual bool GetCScript(const CScriptID &hash, CScript &redeemScriptOut) const override
virtual WalletDatabase & GetDatabase() const =0
util::Result< CTxDestination > GetNewDestination(const OutputType type) override
void AddKeypoolPubkeyWithDB(const CPubKey &pubkey, const bool internal, WalletBatch &batch)
std::map< int64_t, CKeyID > m_index_to_reserved_key
bool NewKeyPool()
Mark old keypool keys as used, and generate all new keys.
is a home for simple string functions returning descriptive messages that are used in RPC and GUI int...
bool CanGenerateKeys() const
unsigned int GetKeyPoolSize() const override
virtual bool Encrypt(const CKeyingMaterial &master_key, WalletBatch *batch)
RecursiveMutex cs_KeyStore
bool GetPubKey(const CKeyID &address, CPubKey &pubkey) const override
bool fDecryptionThoroughlyChecked
keeps track of whether Unlock has run a thorough check before
Taproot only; implied when sighash byte is missing, and equivalent to SIGHASH_ALL.
bool TopUpInactiveHDChain(const CKeyID seed_id, int64_t index, bool internal)
Like TopUp() but adds keys for inactive HD chains.
bilingual_str Untranslated(std::string original)
Mark a bilingual_str as untranslated.
bool AddCScript(const CScript &redeemScript) override
SigningResult SignMessage(const std::string &message, const PKHash &pkhash, std::string &str_sig) const override
Sign a message with the given script.
bool CanGetAddresses(bool internal=false) const override
struct containing information needed for migrating legacy wallets to descriptor wallets ...
bool LoadKey(const CKey &key, const CPubKey &pubkey)
Adds a key to the store, without saving it to disk (used by LoadWallet)
std::vector< std::pair< std::string, int64_t > > solvable_descs
std::map< CKeyID, CKey > KeyMap
bool CanUpdateToWalletDescriptor(const WalletDescriptor &descriptor, std::string &error)
DescriptorScriptPubKeyMan(WalletStorage &storage, int64_t keypool_size)
boost::signals2::signal< void()> NotifyCanGetAddressesChanged
Keypool has new keys.
virtual bool CheckDecryptionKey(const CKeyingMaterial &master_key)
Check that the given decryption key is valid for this ScriptPubKeyMan, i.e. it decrypts all of the ke...
static const unsigned int DEFAULT_KEYPOOL_SIZE
Default for -keypool.
bool AddWatchOnly(const CScript &dest) EXCLUSIVE_LOCKS_REQUIRED(cs_KeyStore)
Private version of AddWatchOnly method which does not accept a timestamp, and which will reset the wa...
std::vector< std::pair< std::string, int64_t > > watch_descs
void AddInactiveHDChain(const CHDChain &chain)
bool AddKeyPubKeyWithDB(WalletBatch &batch, const CKey &key, const CPubKey &pubkey) EXCLUSIVE_LOCKS_REQUIRED(cs_KeyStore)
Adds a key to the store, and saves it to disk.
bool m_pre_split
Whether this key was generated for a keypool before the wallet was upgraded to HD-split.
void UpdateWalletDescriptor(WalletDescriptor &descriptor)
bool ImportScriptPubKeys(const std::set< CScript > &script_pub_keys, const bool have_solving_data, const int64_t timestamp) EXCLUSIVE_LOCKS_REQUIRED(cs_KeyStore)
void SetHDSeed(const CPubKey &key)
A version of CTransaction with the PSBT format.
virtual void UnsetBlankWalletFlag(WalletBatch &)=0
void LoadHDChain(const CHDChain &chain)
Load a HD chain model (used by LoadWallet)
Access to the wallet database.
A key from a CWallet's keypool.
boost::signals2::signal< void(const ScriptPubKeyMan *spkm, int64_t new_birth_time)> NotifyFirstKeyTimeChanged
Birth time changed.
void Unserialize(Stream &s)
bool AddKey(const CKeyID &key_id, const CKey &key)
bool AddWatchOnlyWithDB(WalletBatch &batch, const CScript &dest) EXCLUSIVE_LOCKS_REQUIRED(cs_KeyStore)
virtual bool SignTransaction(CMutableTransaction &tx, const std::map< COutPoint, Coin > &coins, int sighash, std::map< int, bilingual_str > &input_errors) const
Creates new signatures and adds them to the transaction.
void LoadKeyPool(int64_t nIndex, const CKeyPool &keypool)
Load a keypool entry.
bool Encrypt(const CKeyingMaterial &master_key, WalletBatch *batch) override
virtual bool IsLocked() const =0
virtual bool CanProvide(const CScript &script, SignatureData &sigdata)
Whether this ScriptPubKeyMan can provide a SigningProvider (via GetSolvingProvider) that...
unsigned int GetKeyPoolSize() const override
bool IsHDEnabled() const override
std::map< CPubKey, int32_t > PubKeyMap
bool GetWatchPubKey(const CKeyID &address, CPubKey &pubkey_out) const
Fetches a pubkey from mapWatchKeys if it exists there.
int64_t nTime
The time at which the key was generated. Set in AddKeypoolPubKeyWithDB.
virtual std::optional< int64_t > GetOldestKeyPoolTime() const
CryptedKeyMap mapCryptedKeys GUARDED_BY(cs_KeyStore)
int64_t m_keypool_size GUARDED_BY(cs_KeyStore)
Number of pre-generated keys/scripts (part of the look-ahead process, used to detect payments) ...
bool CanGetAddresses(bool internal=false) const override
bool AddWatchOnlyInMem(const CScript &dest)
bool LoadWatchOnly(const CScript &dest)
Adds a watch-only address to the store, without saving it to disk (used by LoadWallet) ...
bool AddCryptedKeyInner(const CPubKey &vchPubKey, const std::vector< unsigned char > &vchCryptedSecret)
void SetCache(const DescriptorCache &cache)
virtual isminetype IsMine(const CScript &script) const
bool CanProvide(const CScript &script, SignatureData &sigdata) override
Whether this ScriptPubKeyMan can provide a SigningProvider (via GetSolvingProvider) that...
isminetype IsMine(const CScript &script) const override
bool AddCryptedKey(const CKeyID &key_id, const CPubKey &pubkey, const std::vector< unsigned char > &crypted_key)
WalletDescriptor GetWalletDescriptor() const EXCLUSIVE_LOCKS_REQUIRED(cs_desc_man)
bool GetKeyOrigin(const CKeyID &keyid, KeyOriginInfo &info) const override
virtual std::unique_ptr< SigningProvider > GetSolvingProvider(const CScript &script) const
std::map< CKeyID, CPubKey > WatchKeyMap
ScriptPubKeyMan(WalletStorage &storage)
bool GetKey(const CKeyID &address, CKey &keyOut) const override
virtual ~ScriptPubKeyMan()=default
static constexpr int64_t UNKNOWN_TIME
Constant representing an unknown spkm creation time.
size_t KeypoolCountExternalKeys() const
bool CanProvide(const CScript &script, SignatureData &sigdata) override
Whether this ScriptPubKeyMan can provide a SigningProvider (via GetSolvingProvider) that...
std::set< CKeyID > GetKeys() const override
bool HavePrivateKeys() const override
virtual bool CanSupportFeature(enum WalletFeature) const =0
CPubKey vchPubKey
The public key.
bool fInternal
Whether this keypool entry is in the internal keypool (for change outputs)
void ReturnDestination(int64_t index, bool internal, const CTxDestination &addr) override
std::vector< CKeyID > GetAffectedKeys(const CScript &spk, const SigningProvider &provider)
std::map< CKeyID, int64_t > m_pool_key_to_index
virtual void SetMinVersion(enum WalletFeature, WalletBatch *=nullptr)=0
void RewriteDB() override
The action to do when the DB needs rewrite.
virtual bool HasEncryptionKeys() const =0
bool Encrypt(const CKeyingMaterial &master_key, WalletBatch *batch) override
std::optional< int64_t > GetOldestKeyPoolTime() const override
int32_t GetEndRange() const
Wraps a LegacyScriptPubKeyMan so that it can be returned in a new unique_ptr.
bool HaveKey(const CKeyID &address) const override
void AddHDChain(const CHDChain &chain)
virtual std::vector< WalletDestination > MarkUnusedAddresses(const CScript &script)
Mark unused addresses as being used Affects all keys up to and including the one determined by provid...
uint256 GetID() const override
An encapsulated public key.
Fillable signing provider that keeps keys in an address->secret map.
isminetype
IsMine() return codes, which depend on ScriptPubKeyMan implementation.
bool LoadCryptedKey(const CPubKey &vchPubKey, const std::vector< unsigned char > &vchCryptedSecret, bool checksum_valid)
Adds an encrypted key to the store, without saving it to disk (used by LoadWallet) ...
SigningResult SignMessage(const std::string &message, const PKHash &pkhash, std::string &str_sig) const override
Sign a message with the given script.
WalletFeature
(client) version numbers for particular wallet features
std::unique_ptr< SigningProvider > GetSolvingProvider(const CScript &script) const override
is a home for simple enum and struct type definitions that can be used internally by functions in the...
isminetype IsMine(const CScript &script) const override
void ReturnDestination(int64_t index, bool internal, const CTxDestination &) override
WalletBatch *encrypted_batch GUARDED_BY(cs_KeyStore)
ScriptPubKeyMap m_map_script_pub_keys GUARDED_BY(cs_desc_man)
std::map< CScript, int32_t > ScriptPubKeyMap
bool GetKeyOrigin(const CKeyID &keyid, KeyOriginInfo &info) const override
std::unordered_set< CScript, SaltedSipHasher > GetScriptPubKeys() const override
Returns a set of all the scriptPubKeys that this ScriptPubKeyMan watches.
std::optional< MigrationData > MigrateToDescriptor()
Get the DescriptorScriptPubKeyMans (with private keys) that have the same scriptPubKeys as this Legac...
virtual bool IsHDEnabled() const
util::Result< CTxDestination > GetReservedDestination(const OutputType type, bool internal, int64_t &index, CKeyPool &keypool) override
virtual void LoadKeyMetadata(const CKeyID &keyID, const CKeyMetadata &metadata)
Load metadata (used by LoadWallet)
virtual std::unique_ptr< CKeyMetadata > GetMetadata(const CTxDestination &dest) const
static const std::unordered_set< OutputType > LEGACY_OUTPUT_TYPES
OutputTypes supported by the LegacyScriptPubKeyMan.
std::optional< int64_t > GetOldestKeyPoolTime() const override
is a home for public enum and struct type definitions that are used by internally by wallet code...
virtual void TopUpCallback(const std::set< CScript > &, ScriptPubKeyMan *)=0
Callback function for after TopUp completes containing any scripts that were added by a SPKMan...
bool SignTransaction(CMutableTransaction &tx, const std::map< COutPoint, Coin > &coins, int sighash, std::map< int, bilingual_str > &input_errors) const override
Creates new signatures and adds them to the transaction.
uint256 GetID() const override
void UpgradeDescriptorCache()
Descriptor with some wallet metadata.
bool ImportPubKeys(const std::vector< CKeyID > &ordered_pubkeys, const std::map< CKeyID, CPubKey > &pubkey_map, const std::map< CKeyID, std::pair< CPubKey, KeyOriginInfo >> &key_origins, const bool add_keypool, const bool internal, const int64_t timestamp) EXCLUSIVE_LOCKS_REQUIRED(cs_KeyStore)
virtual bool HavePrivateKeys() const
bool HaveCScript(const CScriptID &scriptid) const override
bool AddCScriptWithDB(WalletBatch &batch, const CScript &script)
Adds a script to the store and saves it to disk.
virtual void KeepDestination(int64_t index, const OutputType &type)
virtual unsigned int GetKeyPoolSize() const
virtual bool AddKeyPubKeyInner(const CKey &key, const CPubKey &pubkey)
std::unique_ptr< SigningProvider > GetSolvingProvider(const CScript &script) const override
virtual void RewriteDB()
The action to do when the DB needs rewrite.
bool HaveWatchOnly() const
Returns whether there are any watch-only things in the wallet.
uint256 GetID() const override
virtual void LoadScriptMetadata(const CScriptID &script_id, const CKeyMetadata &metadata)
virtual bool CanGetAddresses(bool internal=false) const
bool DeleteRecords()
Delete all the records ofthis LegacyScriptPubKeyMan from disk.
CPubKey DeriveNewSeed(const CKey &key)
std::optional< common::PSBTError > FillPSBT(PartiallySignedTransaction &psbt, const PrecomputedTransactionData &txdata, int sighash_type=SIGHASH_DEFAULT, bool sign=true, bool bip32derivs=false, int *n_signed=nullptr, bool finalize=true) const override
Adds script and derivation path information to a PSBT, and optionally signs it.
#define EXCLUSIVE_LOCKS_REQUIRED(...)
bool TopUpChain(WalletBatch &batch, CHDChain &chain, unsigned int size)
void LearnRelatedScripts(const CPubKey &key, OutputType)
Explicitly make the wallet learn the related scripts for outputs to the given key.
void WalletLogPrintf(const char *fmt, Params... parameters) const
Prepends the wallet name in logging output to ease debugging in multi-wallet use cases.
virtual bool WithEncryptionKey(std::function< bool(const CKeyingMaterial &)> cb) const =0
Pass the encryption key to cb().
An interface to be implemented by keystores that support signing.
util::Result< CTxDestination > GetReservedDestination(const OutputType type, bool internal, int64_t &index, CKeyPool &keypool) override
std::optional< common::PSBTError > FillPSBT(PartiallySignedTransaction &psbt, const PrecomputedTransactionData &txdata, int sighash_type=SIGHASH_DEFAULT, bool sign=true, bool bip32derivs=false, int *n_signed=nullptr, bool finalize=true) const override
Adds script and derivation path information to a PSBT, and optionally signs it.
bool ImportScripts(const std::set< CScript > scripts, int64_t timestamp) EXCLUSIVE_LOCKS_REQUIRED(cs_KeyStore)
const CChainParams & Params()
Return the currently selected parameters.
Cache for single descriptor's derived extended pubkeys.
bool GetDescriptorString(std::string &out, const bool priv) const
std::map< CKeyID, std::pair< CPubKey, std::vector< unsigned char > >> CryptedKeyMap
Serialized script, used inside transaction inputs and outputs.
CPubKey GenerateNewSeed()
virtual util::Result< CTxDestination > GetReservedDestination(const OutputType type, bool internal, int64_t &index, CKeyPool &keypool)
std::variant< CNoDestination, PubKeyDestination, PKHash, ScriptHash, WitnessV0ScriptHash, WitnessV0KeyHash, WitnessV1Taproot, PayToAnchor, WitnessUnknown > CTxDestination
A txout script categorized into standard templates.
RecursiveMutex cs_desc_man
bool SetupGeneration(bool force=false) override
Sets up the key generation stuff, i.e.
void LearnAllRelatedScripts(const CPubKey &key)
Same as LearnRelatedScripts, but when the OutputType is not known (and could be anything).
std::map< CKeyID, std::pair< CPubKey, std::vector< unsigned char > >> CryptedKeyMap
A reference to a CKey: the Hash160 of its serialized public key.
std::unique_ptr< CKeyMetadata > GetMetadata(const CTxDestination &dest) const override
std::map< int32_t, FlatSigningProvider > m_map_signing_providers
std::set< CScript > WatchOnlySet
bool m_decryption_thoroughly_checked
keeps track of whether Unlock has run a thorough check before
virtual bool HaveCScript(const CScriptID &hash) const override
void Serialize(Stream &s) const
void AddDescriptorKey(const CKey &key, const CPubKey &pubkey)
A reference to a CScript: the Hash160 of its serialization.
A mutable version of CTransaction.
bool IsHDEnabled() const override
CPubKey GenerateNewKey(WalletBatch &batch, CHDChain &hd_chain, bool internal=false) EXCLUSIVE_LOCKS_REQUIRED(cs_KeyStore)
Generate a new key.
bool GetKeyFromPool(CPubKey &key, const OutputType type)
Fetches a key from the keypool.
int64_t m_keypool_size GUARDED_BY(cs_desc_man)
Number of pre-generated keys/scripts (part of the look-ahead process, used to detect payments) ...
bool AddDescriptorKeyWithDB(WalletBatch &batch, const CKey &key, const CPubKey &pubkey) EXCLUSIVE_LOCKS_REQUIRED(cs_desc_man)
KeyMap GetKeys() const EXCLUSIVE_LOCKS_REQUIRED(cs_desc_man)
void LoadScriptMetadata(const CScriptID &script_id, const CKeyMetadata &metadata) override
void KeepDestination(int64_t index, const OutputType &type) override
std::unique_ptr< CKeyMetadata > GetMetadata(const CTxDestination &dest) const override
bool TopUp(unsigned int size=0) override
Fills internal address pool.
std::vector< CKeyPool > MarkReserveKeysAsUsed(int64_t keypool_id) EXCLUSIVE_LOCKS_REQUIRED(cs_KeyStore)
Marks all keys in the keypool up to and including the provided key as used.
virtual void ReturnDestination(int64_t index, bool internal, const CTxDestination &addr)
An encapsulated private key.
bool HavePrivateKeys() const override
bool ReserveKeyFromKeyPool(int64_t &nIndex, CKeyPool &keypool, bool fRequestedInternal)
Reserves a key from the keypool and sets nIndex to its index.
virtual int64_t GetTimeFirstKey() const
bool HasPrivKey(const CKeyID &keyid) const EXCLUSIVE_LOCKS_REQUIRED(cs_desc_man)
std::unordered_map< CKeyID, CHDChain, SaltedSipHasher > m_inactive_hd_chains
void DeriveNewChildKey(WalletBatch &batch, CKeyMetadata &metadata, CKey &secret, CHDChain &hd_chain, bool internal=false) EXCLUSIVE_LOCKS_REQUIRED(cs_KeyStore)
virtual bool TopUp(unsigned int size=0)
Fills internal address pool.
virtual std::unordered_set< CScript, SaltedSipHasher > GetScriptPubKeys() const
Returns a set of all the scriptPubKeys that this ScriptPubKeyMan watches.
is a home for public enum and struct type definitions that are used by internally by node code...
int32_t m_max_cached_index
bool HaveKey(const CKeyID &address) const override
virtual util::Result< CTxDestination > GetNewDestination(const OutputType type)
bool LoadCScript(const CScript &redeemScript)
Adds a CScript to the store.
int64_t GetTime()
DEPRECATED, see GetTime.
std::unordered_set< CScript, SaltedSipHasher > GetNotMineScriptPubKeys() const
Retrieves scripts that were imported by bugs into the legacy spkm and are simply invalid, such as a sh(sh(pkh())) script, or not watched.
std::unordered_set< CScript, SaltedSipHasher > GetScriptPubKeys() const override
Returns a set of all the scriptPubKeys that this ScriptPubKeyMan watches.
virtual ~WalletStorage()=default
const CHDChain & GetHDChain() const
virtual bool Upgrade(int prev_version, int new_version, bilingual_str &error)
Upgrades the wallet to the specified version.
LegacySigningProvider(const LegacyDataSPKM &spk_man)
bool AddKeyPubKeyInner(const CKey &key, const CPubKey &pubkey) override
bool TopUpWithDB(WalletBatch &batch, unsigned int size=0)
Same as 'TopUp' but designed for use within a batch transaction context.
virtual bool SetupGeneration(bool force=false)
Sets up the key generation stuff, i.e.
const std::map< CKeyID, int64_t > & GetAllReserveKeys() const
bool HasWalletDescriptor(const WalletDescriptor &desc) const
boost::signals2::signal< void(bool fHaveWatchOnly)> NotifyWatchonlyChanged
Watch-only address added.
An instance of this class represents one database.
int64_t GetTimeFirstKey() const override
bool TopUp(unsigned int size=0) override
Fills internal address pool.
std::vector< unsigned char, secure_allocator< unsigned char > > CKeyingMaterial
void MarkPreSplitKeys() EXCLUSIVE_LOCKS_REQUIRED(cs_KeyStore)
std::vector< std::unique_ptr< DescriptorScriptPubKeyMan > > desc_spkms
util::Result< CTxDestination > GetNewDestination(const OutputType type) override
bool SignTransaction(CMutableTransaction &tx, const std::map< COutPoint, Coin > &coins, int sighash, std::map< int, bilingual_str > &input_errors) const override
Creates new signatures and adds them to the transaction.
const LegacyDataSPKM & m_spk_man
std::unique_ptr< FlatSigningProvider > GetSigningProvider(const CScript &script, bool include_private=false) const
void LoadKeyMetadata(const CKeyID &keyID, const CKeyMetadata &metadata) override
Load metadata (used by LoadWallet)
WalletStorage & m_storage
bool AddKeyOriginWithDB(WalletBatch &batch, const CPubKey &pubkey, const KeyOriginInfo &info)
Add a KeyOriginInfo to the wallet.