Bitcoin Core 32.99.0
P2P Digital Currency
Public Member Functions | Static Public Member Functions | Public Attributes | Protected Member Functions | Private Types | Private Member Functions | Private Attributes | List of all members
wallet::DescriptorScriptPubKeyMan Class Reference

#include <scriptpubkeyman.h>

Inheritance diagram for wallet::DescriptorScriptPubKeyMan:
[legend]
Collaboration diagram for wallet::DescriptorScriptPubKeyMan:
[legend]

Public Member Functions

util::Result< CTxDestination > GetNewDestination (OutputType type) override
 
bool IsMine (const CScript &script) 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 keys handled by it. More...
 
bool Encrypt (const CKeyingMaterial &master_key, WalletBatch *batch) override
 Encrypt keys and write them to a batch with an active transaction. Update in-memory keys only after the transaction commits. More...
 
util::Result< CTxDestination > GetReservedDestination (OutputType type, bool internal, int64_t &index) override
 
void ReturnDestination (int64_t index, bool internal, const CTxDestination &addr) override
 
bool TopUp (unsigned int size=0) override
 Fills internal address pool. More...
 
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 provided script. More...
 
bool IsHDEnabled () const override
 
bool HavePrivateKeys () const override
 
bool HasPrivKey (const CKeyID &keyid) const EXCLUSIVE_LOCKS_REQUIRED(cs_desc_man)
 
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, or if the wallet is locked. More...
 
bool HaveCryptedKeys () const override
 
unsigned int GetKeyPoolSize () const override
 
int64_t GetTimeFirstKey () const override
 
std::unique_ptr< CKeyMetadata > GetMetadata (const CTxDestination &dest) const override
 
bool CanGetAddresses (bool internal=false) const override
 
std::unique_ptr< SigningProvider > GetSolvingProvider (const CScript &script) const override
 
bool CanProvide (const CScript &script, SignatureData &sigdata) override
 Whether this ScriptPubKeyMan can provide a SigningProvider (via GetSolvingProvider) that, combined with sigdata, can produce solving data. More...
 
std::unique_ptr< FlatSigningProvider > GetSigningProvider (const CPubKey &pubkey) const
 
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. More...
 
SigningResult SignMessage (const std::string &message, const PKHash &pkhash, std::string &str_sig) const override
 Sign a message with the given script. More...
 
std::optional< common::PSBTError > FillPSBT (PartiallySignedTransaction &psbt, const PrecomputedTransactionData &txdata, const common::PSBTFillOptions &options, int *n_signed=nullptr) const override
 Adds script and derivation path information to a PSBT, and optionally signs it. More...
 
uint256 GetID () const override
 
bool HasWalletDescriptor (const WalletDescriptor &desc) const
 
util::Result< void > UpdateWalletDescriptor (WalletDescriptor &descriptor, const FlatSigningProvider &provider)
 
bool CanUpdateToWalletDescriptor (const WalletDescriptor &descriptor, std::string &error)
 
void WriteDescriptor ()
 
WalletDescriptor GetWalletDescriptor () const EXCLUSIVE_LOCKS_REQUIRED(cs_desc_man)
 
std::unordered_set< CScript, SaltedSipHasher > GetScriptPubKeys () const override
 Returns a set of all the scriptPubKeys that this ScriptPubKeyMan watches. More...
 
std::unordered_set< CScript, SaltedSipHasher > GetScriptPubKeys (int32_t minimum_index) const
 
int32_t GetEndRange () const
 
bool GetDescriptorString (std::string &out, bool priv) const
 
void UpgradeDescriptorCache ()
 
- Public Member Functions inherited from wallet::ScriptPubKeyMan
 ScriptPubKeyMan (WalletStorage &storage)
 
virtual ~ScriptPubKeyMan ()=default
 
virtual util::Result< CTxDestination > GetNewDestination (const OutputType type)
 
virtual bool IsMine (const CScript &script) const
 
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 keys handled by it. More...
 
virtual bool Encrypt (const CKeyingMaterial &master_key, WalletBatch *batch)
 Encrypt keys and write them to a batch with an active transaction. Update in-memory keys only after the transaction commits. More...
 
virtual util::Result< CTxDestination > GetReservedDestination (const OutputType type, bool internal, int64_t &index)
 
virtual void KeepDestination (int64_t index, const OutputType &type)
 
virtual void ReturnDestination (int64_t index, bool internal, const CTxDestination &addr)
 
virtual bool TopUp (unsigned int size=0)
 Fills internal address pool. More...
 
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 provided script. More...
 
virtual bool IsHDEnabled () const
 
virtual bool CanGetAddresses (bool internal=false) const
 
virtual bool HavePrivateKeys () const
 
virtual bool HaveCryptedKeys () const
 
virtual unsigned int GetKeyPoolSize () const
 
virtual int64_t GetTimeFirstKey () const
 
virtual std::unique_ptr< CKeyMetadata > GetMetadata (const CTxDestination &dest) const
 
virtual std::unique_ptr< SigningProvider > GetSolvingProvider (const CScript &script) const
 
virtual bool CanProvide (const CScript &script, SignatureData &sigdata)
 Whether this ScriptPubKeyMan can provide a SigningProvider (via GetSolvingProvider) that, combined with sigdata, can produce solving data. More...
 
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. More...
 
virtual SigningResult SignMessage (const std::string &message, const PKHash &pkhash, std::string &str_sig) const
 Sign a message with the given script. More...
 
virtual std::optional< common::PSBTError > FillPSBT (PartiallySignedTransaction &psbt, const PrecomputedTransactionData &txdata, const common::PSBTFillOptions &options, int *n_signed=nullptr) const
 Adds script and derivation path information to a PSBT, and optionally signs it. More...
 
virtual uint256 GetID () const
 
virtual std::unordered_set< CScript, SaltedSipHasher > GetScriptPubKeys () const
 Returns a set of all the scriptPubKeys that this ScriptPubKeyMan watches. More...
 
template<typename... Params>
void WalletLogPrintf (util::ConstevalFormatString< sizeof...(Params)> wallet_fmt, const Params &... params) const
 Prepends the wallet name in logging output to ease debugging in multi-wallet use cases. More...
 

Static Public Member Functions

static std::unique_ptr< DescriptorScriptPubKeyMan > LoadFromStorage (WalletStorage &storage, const uint256 &id, WalletDescriptor &descriptor, int64_t keypool_size, const KeyMap &keys, const CryptedKeyMap &ckeys)
 
static std::unique_ptr< DescriptorScriptPubKeyMan > CreateFromImport (WalletStorage &storage, WalletDescriptor &descriptor, int64_t keypool_size, const FlatSigningProvider &provider)
 
static std::unique_ptr< DescriptorScriptPubKeyMan > CreateFromMigration (WalletStorage &storage, WalletBatch &batch, WalletDescriptor &descriptor, int64_t keypool_size, const FlatSigningProvider &provider)
 
static std::unique_ptr< DescriptorScriptPubKeyMan > GenerateNewSingleSig (WalletStorage &storage, WalletBatch &batch, int64_t keypool_size, const CExtKey &master_key, OutputType addr_type, bool internal)
 

Public Attributes

RecursiveMutex cs_desc_man
 
- Public Attributes inherited from wallet::ScriptPubKeyMan
btcsignals::signal< void()> NotifyCanGetAddressesChanged
 Keypool has new keys. More...
 
btcsignals::signal< void(const ScriptPubKeyMan *spkm, int64_t new_birth_time)> NotifyFirstKeyTimeChanged
 Birth time changed. More...
 

Protected Member Functions

 DescriptorScriptPubKeyMan (WalletStorage &storage, const uint256 &id, WalletDescriptor &descriptor, int64_t keypool_size, const KeyMap &keys, const CryptedKeyMap &ckeys)
 Create a DescriptorScriptPubKeyMan from existing data (i.e. during loading) More...
 
 DescriptorScriptPubKeyMan (WalletStorage &storage, WalletDescriptor &descriptor, int64_t keypool_size)
 Create a new DescriptorScriptPubKeyMan from a descriptor (e.g. from an import, newly generated) More...
 
WalletDescriptor m_wallet_descriptor GUARDED_BY (cs_desc_man)
 
void IncIndex () EXCLUSIVE_LOCKS_REQUIRED(cs_desc_man)
 
void DecIndex () EXCLUSIVE_LOCKS_REQUIRED(cs_desc_man)
 
void SetRangeEnd (int32_t end) EXCLUSIVE_LOCKS_REQUIRED(cs_desc_man)
 
bool TopUpWithDB (WalletBatch &batch, unsigned int size=0)
 Same as 'TopUp' but designed for use within a batch transaction context. More...
 

Private Types

using ScriptPubKeyMap = std::map< CScript, int32_t >
 
using PubKeyMap = std::map< CPubKey, int32_t >
 

Private Member Functions

ScriptPubKeyMap m_map_script_pub_keys GUARDED_BY (cs_desc_man)
 
PubKeyMap m_map_pubkeys GUARDED_BY (cs_desc_man)
 
KeyMap m_map_keys GUARDED_BY (cs_desc_man)
 
CryptedKeyMap m_map_crypted_keys GUARDED_BY (cs_desc_man)
 
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) More...
 
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)
 
std::unique_ptr< FlatSigningProvider > GetSigningProvider (const CScript &script, bool include_private=false) const
 
std::unique_ptr< FlatSigningProvider > GetSigningProvider (int32_t index, bool include_private=false) const EXCLUSIVE_LOCKS_REQUIRED(cs_desc_man)
 
void Load ()
 
void UpdateWithSigningProvider (WalletBatch &batch, const FlatSigningProvider &signing_provider) EXCLUSIVE_LOCKS_REQUIRED(cs_desc_man)
 

Private Attributes

int32_t m_max_cached_index = -1
 
bool m_decryption_thoroughly_checked = false
 keeps track of whether Unlock has run a thorough check before More...
 
std::map< uint256, MuSig2SecNonce > m_musig2_secnonces
 Map of a session id to MuSig2 secnonce. More...
 
const uint256 m_id
 
std::map< int32_t, FlatSigningProvider > m_map_signing_providers
 

Additional Inherited Members

- Protected Attributes inherited from wallet::ScriptPubKeyMan
WalletStorage & m_storage
 

Detailed Description

Definition at line 273 of file scriptpubkeyman.h.

Member Typedef Documentation

◆ PubKeyMap

using wallet::DescriptorScriptPubKeyMan::PubKeyMap = std::map<CPubKey, int32_t>
private

Definition at line 277 of file scriptpubkeyman.h.

◆ ScriptPubKeyMap

using wallet::DescriptorScriptPubKeyMan::ScriptPubKeyMap = std::map<CScript, int32_t>
private

Definition at line 276 of file scriptpubkeyman.h.

Constructor & Destructor Documentation

◆ DescriptorScriptPubKeyMan() [1/2]

wallet::DescriptorScriptPubKeyMan::DescriptorScriptPubKeyMan ( WalletStorage &  storage,
const uint256 &  id,
WalletDescriptor &  descriptor,
int64_t  keypool_size,
const KeyMap &  keys,
const CryptedKeyMap &  ckeys 
)
protected

Create a DescriptorScriptPubKeyMan from existing data (i.e. during loading)

Definition at line 849 of file scriptpubkeyman.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ DescriptorScriptPubKeyMan() [2/2]

wallet::DescriptorScriptPubKeyMan::DescriptorScriptPubKeyMan ( WalletStorage &  storage,
WalletDescriptor &  descriptor,
int64_t  keypool_size 
)
inlineprotected

Create a new DescriptorScriptPubKeyMan from a descriptor (e.g. from an import, newly generated)

Definition at line 327 of file scriptpubkeyman.h.

Member Function Documentation

◆ AddDescriptorKeyWithDB()

bool wallet::DescriptorScriptPubKeyMan::AddDescriptorKeyWithDB ( WalletBatch &  batch,
const CKey &  key,
const CPubKey &  pubkey 
)
private

Definition at line 1209 of file scriptpubkeyman.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ CanGetAddresses()

bool wallet::DescriptorScriptPubKeyMan::CanGetAddresses ( bool  internal = false) const
overridevirtual

Reimplemented from wallet::ScriptPubKeyMan.

Definition at line 1252 of file scriptpubkeyman.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ CanProvide()

bool wallet::DescriptorScriptPubKeyMan::CanProvide ( const CScript &  script,
SignatureData &  sigdata 
)
overridevirtual

Whether this ScriptPubKeyMan can provide a SigningProvider (via GetSolvingProvider) that, combined with sigdata, can produce solving data.

Reimplemented from wallet::ScriptPubKeyMan.

Definition at line 1356 of file scriptpubkeyman.cpp.

Here is the call graph for this function:

◆ CanUpdateToWalletDescriptor()

bool wallet::DescriptorScriptPubKeyMan::CanUpdateToWalletDescriptor ( const WalletDescriptor &  descriptor,
std::string &  error 
)

Definition at line 1668 of file scriptpubkeyman.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ CheckDecryptionKey()

bool wallet::DescriptorScriptPubKeyMan::CheckDecryptionKey ( const CKeyingMaterial &  master_key)
overridevirtual

Check that the given decryption key is valid for this ScriptPubKeyMan, i.e. it decrypts all of the keys handled by it.

Reimplemented from wallet::ScriptPubKeyMan.

Definition at line 978 of file scriptpubkeyman.cpp.

Here is the call graph for this function:

◆ CreateFromImport()

std::unique_ptr< DescriptorScriptPubKeyMan > wallet::DescriptorScriptPubKeyMan::CreateFromImport ( WalletStorage &  storage,
WalletDescriptor &  descriptor,
int64_t  keypool_size,
const FlatSigningProvider &  provider 
)
static

Definition at line 832 of file scriptpubkeyman.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ CreateFromMigration()

std::unique_ptr< DescriptorScriptPubKeyMan > wallet::DescriptorScriptPubKeyMan::CreateFromMigration ( WalletStorage &  storage,
WalletBatch &  batch,
WalletDescriptor &  descriptor,
int64_t  keypool_size,
const FlatSigningProvider &  provider 
)
static

Definition at line 841 of file scriptpubkeyman.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ DecIndex()

void wallet::DescriptorScriptPubKeyMan::DecIndex ( )
protected

Definition at line 909 of file scriptpubkeyman.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ Encrypt()

bool wallet::DescriptorScriptPubKeyMan::Encrypt ( const CKeyingMaterial &  master_key,
WalletBatch *  batch 
)
overridevirtual

Encrypt keys and write them to a batch with an active transaction. Update in-memory keys only after the transaction commits.

Reimplemented from wallet::ScriptPubKeyMan.

Definition at line 1010 of file scriptpubkeyman.cpp.

Here is the call graph for this function:

◆ FillPSBT()

std::optional< PSBTError > wallet::DescriptorScriptPubKeyMan::FillPSBT ( PartiallySignedTransaction &  psbt,
const PrecomputedTransactionData &  txdata,
const common::PSBTFillOptions &  options,
int *  n_signed = nullptr 
) const
overridevirtual

Adds script and derivation path information to a PSBT, and optionally signs it.

Reimplemented from wallet::ScriptPubKeyMan.

Definition at line 1393 of file scriptpubkeyman.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ GenerateNewSingleSig()

std::unique_ptr< DescriptorScriptPubKeyMan > wallet::DescriptorScriptPubKeyMan::GenerateNewSingleSig ( WalletStorage &  storage,
WalletBatch &  batch,
int64_t  keypool_size,
const CExtKey &  master_key,
OutputType  addr_type,
bool  internal 
)
static

Definition at line 868 of file scriptpubkeyman.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ GetDescriptorString()

bool wallet::DescriptorScriptPubKeyMan::GetDescriptorString ( std::string &  out,
bool  priv 
) const

Definition at line 1586 of file scriptpubkeyman.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ GetEndRange()

int32_t wallet::DescriptorScriptPubKeyMan::GetEndRange ( ) const

Definition at line 1581 of file scriptpubkeyman.cpp.

◆ GetID()

uint256 wallet::DescriptorScriptPubKeyMan::GetID ( ) const
overridevirtual

Reimplemented from wallet::ScriptPubKeyMan.

Definition at line 1506 of file scriptpubkeyman.cpp.

Here is the caller graph for this function:

◆ GetKey()

std::optional< CKey > wallet::DescriptorScriptPubKeyMan::GetKey ( const CKeyID &  keyid) const

Retrieve the particular key if it is available. Returns nullopt if the key is not in the wallet, or if the wallet is locked.

Definition at line 1086 of file scriptpubkeyman.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ GetKeyPoolSize()

unsigned int wallet::DescriptorScriptPubKeyMan::GetKeyPoolSize ( ) const
overridevirtual

Reimplemented from wallet::ScriptPubKeyMan.

Definition at line 1274 of file scriptpubkeyman.cpp.

◆ GetKeys()

std::map< CKeyID, CKey > wallet::DescriptorScriptPubKeyMan::GetKeys ( ) const
private

Definition at line 1061 of file scriptpubkeyman.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ GetMetadata()

std::unique_ptr< CKeyMetadata > wallet::DescriptorScriptPubKeyMan::GetMetadata ( const CTxDestination &  dest) const
overridevirtual

Reimplemented from wallet::ScriptPubKeyMan.

Definition at line 1488 of file scriptpubkeyman.cpp.

Here is the call graph for this function:

◆ GetNewDestination()

util::Result< CTxDestination > wallet::DescriptorScriptPubKeyMan::GetNewDestination ( OutputType  type)
overridevirtual

Reimplemented from wallet::ScriptPubKeyMan.

Definition at line 933 of file scriptpubkeyman.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ GetReservedDestination()

util::Result< CTxDestination > wallet::DescriptorScriptPubKeyMan::GetReservedDestination ( OutputType  type,
bool  internal,
int64_t &  index 
)
overridevirtual

Reimplemented from wallet::ScriptPubKeyMan.

Definition at line 1043 of file scriptpubkeyman.cpp.

Here is the call graph for this function:

◆ GetScriptPubKeys() [1/2]

std::unordered_set< CScript, SaltedSipHasher > wallet::DescriptorScriptPubKeyMan::GetScriptPubKeys ( ) const
overridevirtual

Returns a set of all the scriptPubKeys that this ScriptPubKeyMan watches.

Reimplemented from wallet::ScriptPubKeyMan.

Definition at line 1564 of file scriptpubkeyman.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ GetScriptPubKeys() [2/2]

std::unordered_set< CScript, SaltedSipHasher > wallet::DescriptorScriptPubKeyMan::GetScriptPubKeys ( int32_t  minimum_index) const

Definition at line 1569 of file scriptpubkeyman.cpp.

◆ GetSigningProvider() [1/3]

std::unique_ptr< FlatSigningProvider > wallet::DescriptorScriptPubKeyMan::GetSigningProvider ( const CPubKey &  pubkey) const

Definition at line 1300 of file scriptpubkeyman.cpp.

Here is the call graph for this function:

◆ GetSigningProvider() [2/3]

std::unique_ptr< FlatSigningProvider > wallet::DescriptorScriptPubKeyMan::GetSigningProvider ( const CScript &  script,
bool  include_private = false 
) const
private

Definition at line 1286 of file scriptpubkeyman.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ GetSigningProvider() [3/3]

std::unique_ptr< FlatSigningProvider > wallet::DescriptorScriptPubKeyMan::GetSigningProvider ( int32_t  index,
bool  include_private = false 
) const
private

Definition at line 1319 of file scriptpubkeyman.cpp.

Here is the call graph for this function:

◆ GetSolvingProvider()

std::unique_ptr< SigningProvider > wallet::DescriptorScriptPubKeyMan::GetSolvingProvider ( const CScript &  script) const
overridevirtual

Reimplemented from wallet::ScriptPubKeyMan.

Definition at line 1351 of file scriptpubkeyman.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ GetTimeFirstKey()

int64_t wallet::DescriptorScriptPubKeyMan::GetTimeFirstKey ( ) const
overridevirtual

Reimplemented from wallet::ScriptPubKeyMan.

Definition at line 1280 of file scriptpubkeyman.cpp.

◆ GetWalletDescriptor()

WalletDescriptor wallet::DescriptorScriptPubKeyMan::GetWalletDescriptor ( ) const

Definition at line 1559 of file scriptpubkeyman.cpp.

Here is the caller graph for this function:

◆ GUARDED_BY() [1/6]

ScriptPubKeyMap m_map_script_pub_keys wallet::DescriptorScriptPubKeyMan::GUARDED_BY ( cs_desc_man  )
private

◆ GUARDED_BY() [2/6]

PubKeyMap m_map_pubkeys wallet::DescriptorScriptPubKeyMan::GUARDED_BY ( cs_desc_man  )
private

◆ GUARDED_BY() [3/6]

KeyMap m_map_keys wallet::DescriptorScriptPubKeyMan::GUARDED_BY ( cs_desc_man  )
private

◆ GUARDED_BY() [4/6]

CryptedKeyMap m_map_crypted_keys wallet::DescriptorScriptPubKeyMan::GUARDED_BY ( cs_desc_man  )
private

◆ GUARDED_BY() [5/6]

int64_t m_keypool_size wallet::DescriptorScriptPubKeyMan::GUARDED_BY ( cs_desc_man  )
inlineprivate

Number of pre-generated keys/scripts (part of the look-ahead process, used to detect payments)

Definition at line 290 of file scriptpubkeyman.h.

◆ GUARDED_BY() [6/6]

WalletDescriptor m_wallet_descriptor wallet::DescriptorScriptPubKeyMan::GUARDED_BY ( cs_desc_man  )
protected

◆ HasPrivKey()

bool wallet::DescriptorScriptPubKeyMan::HasPrivKey ( const CKeyID &  keyid) const

Definition at line 1080 of file scriptpubkeyman.cpp.

Here is the call graph for this function:

◆ HasWalletDescriptor()

bool wallet::DescriptorScriptPubKeyMan::HasWalletDescriptor ( const WalletDescriptor &  desc) const

Definition at line 1544 of file scriptpubkeyman.cpp.

Here is the caller graph for this function:

◆ HaveCryptedKeys()

bool wallet::DescriptorScriptPubKeyMan::HaveCryptedKeys ( ) const
overridevirtual

Reimplemented from wallet::ScriptPubKeyMan.

Definition at line 1268 of file scriptpubkeyman.cpp.

◆ HavePrivateKeys()

bool wallet::DescriptorScriptPubKeyMan::HavePrivateKeys ( ) const
overridevirtual

Reimplemented from wallet::ScriptPubKeyMan.

Definition at line 1262 of file scriptpubkeyman.cpp.

Here is the caller graph for this function:

◆ IncIndex()

void wallet::DescriptorScriptPubKeyMan::IncIndex ( )
protected

Definition at line 897 of file scriptpubkeyman.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ IsHDEnabled()

bool wallet::DescriptorScriptPubKeyMan::IsHDEnabled ( ) const
overridevirtual

Reimplemented from wallet::ScriptPubKeyMan.

Definition at line 1246 of file scriptpubkeyman.cpp.

◆ IsMine()

bool wallet::DescriptorScriptPubKeyMan::IsMine ( const CScript &  script) const
overridevirtual

Reimplemented from wallet::ScriptPubKeyMan.

Definition at line 972 of file scriptpubkeyman.cpp.

Here is the caller graph for this function:

◆ Load()

void wallet::DescriptorScriptPubKeyMan::Load ( )
private

Definition at line 1511 of file scriptpubkeyman.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ LoadFromStorage()

std::unique_ptr< DescriptorScriptPubKeyMan > wallet::DescriptorScriptPubKeyMan::LoadFromStorage ( WalletStorage &  storage,
const uint256 &  id,
WalletDescriptor &  descriptor,
int64_t  keypool_size,
const KeyMap &  keys,
const CryptedKeyMap &  ckeys 
)
static

Definition at line 863 of file scriptpubkeyman.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ MarkUnusedAddresses()

std::vector< WalletDestination > wallet::DescriptorScriptPubKeyMan::MarkUnusedAddresses ( const CScript &  script)
overridevirtual

Mark unused addresses as being used Affects all keys up to and including the one determined by provided script.

Parameters
scriptdetermines the last key to mark as used
Returns
All of the addresses affected

Reimplemented from wallet::ScriptPubKeyMan.

Definition at line 1181 of file scriptpubkeyman.cpp.

Here is the call graph for this function:

◆ ReturnDestination()

void wallet::DescriptorScriptPubKeyMan::ReturnDestination ( int64_t  index,
bool  internal,
const CTxDestination &  addr 
)
overridevirtual

Reimplemented from wallet::ScriptPubKeyMan.

Definition at line 1051 of file scriptpubkeyman.cpp.

Here is the call graph for this function:

◆ SetRangeEnd()

void wallet::DescriptorScriptPubKeyMan::SetRangeEnd ( int32_t  end)
protected

Definition at line 921 of file scriptpubkeyman.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ SignMessage()

SigningResult wallet::DescriptorScriptPubKeyMan::SignMessage ( const std::string &  message,
const PKHash &  pkhash,
std::string &  str_sig 
) const
overridevirtual

Sign a message with the given script.

Reimplemented from wallet::ScriptPubKeyMan.

Definition at line 1375 of file scriptpubkeyman.cpp.

Here is the call graph for this function:

◆ SignTransaction()

bool wallet::DescriptorScriptPubKeyMan::SignTransaction ( CMutableTransaction &  tx,
const std::map< COutPoint, Coin > &  coins,
int  sighash,
std::map< int, bilingual_str > &  input_errors 
) const
overridevirtual

Creates new signatures and adds them to the transaction.

Returns whether all inputs were signed

Reimplemented from wallet::ScriptPubKeyMan.

Definition at line 1361 of file scriptpubkeyman.cpp.

Here is the call graph for this function:

◆ TopUp()

bool wallet::DescriptorScriptPubKeyMan::TopUp ( unsigned int  size = 0)
overridevirtual

Fills internal address pool.

Use within ScriptPubKeyMan implementations should be used sparingly and only when something from the address pool is removed, excluding GetNewDestination and GetReservedDestination. External wallet code is primarily responsible for topping up prior to fetching new addresses

Reimplemented from wallet::ScriptPubKeyMan.

Definition at line 1110 of file scriptpubkeyman.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ TopUpWithDB()

bool wallet::DescriptorScriptPubKeyMan::TopUpWithDB ( WalletBatch &  batch,
unsigned int  size = 0 
)
protected

Same as 'TopUp' but designed for use within a batch transaction context.

Definition at line 1119 of file scriptpubkeyman.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ UpdateWalletDescriptor()

util::Result< void > wallet::DescriptorScriptPubKeyMan::UpdateWalletDescriptor ( WalletDescriptor &  descriptor,
const FlatSigningProvider &  provider 
)

Definition at line 1632 of file scriptpubkeyman.cpp.

Here is the call graph for this function:

◆ UpdateWithSigningProvider()

void wallet::DescriptorScriptPubKeyMan::UpdateWithSigningProvider ( WalletBatch &  batch,
const FlatSigningProvider &  signing_provider 
)
private

Definition at line 1651 of file scriptpubkeyman.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ UpgradeDescriptorCache()

void wallet::DescriptorScriptPubKeyMan::UpgradeDescriptorCache ( )

Definition at line 1603 of file scriptpubkeyman.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ WriteDescriptor()

void wallet::DescriptorScriptPubKeyMan::WriteDescriptor ( )

Definition at line 1550 of file scriptpubkeyman.cpp.

Here is the call graph for this function:

Member Data Documentation

◆ cs_desc_man

RecursiveMutex wallet::DescriptorScriptPubKeyMan::cs_desc_man
mutable

Definition at line 348 of file scriptpubkeyman.h.

◆ m_decryption_thoroughly_checked

bool wallet::DescriptorScriptPubKeyMan::m_decryption_thoroughly_checked = false
private

keeps track of whether Unlock has run a thorough check before

Definition at line 287 of file scriptpubkeyman.h.

◆ m_id

const uint256 wallet::DescriptorScriptPubKeyMan::m_id
private

Definition at line 305 of file scriptpubkeyman.h.

◆ m_map_signing_providers

std::map<int32_t, FlatSigningProvider> wallet::DescriptorScriptPubKeyMan::m_map_signing_providers
mutableprivate

Definition at line 312 of file scriptpubkeyman.h.

◆ m_max_cached_index

int32_t wallet::DescriptorScriptPubKeyMan::m_max_cached_index = -1
private

Definition at line 281 of file scriptpubkeyman.h.

◆ m_musig2_secnonces

std::map<uint256, MuSig2SecNonce> wallet::DescriptorScriptPubKeyMan::m_musig2_secnonces
mutableprivate

Map of a session id to MuSig2 secnonce.

Stores MuSig2 secnonces while the MuSig2 signing session is still ongoing. Note that these secnonces must not be reused. In order to avoid being tricked into reusing a nonce, this map is held only in memory and must not be written to disk. The side effect is that signing sessions cannot persist across restarts, but this must be done in order to prevent nonce reuse.

The session id is an arbitrary value set by the signer in order for the signing logic to find ongoing signing sessions, see MuSig2SessionID.

Definition at line 303 of file scriptpubkeyman.h.


The documentation for this class was generated from the following files: