![]() |
Bitcoin ABC 0.32.12
P2P Digital Currency
|
#include <scriptpubkeyman.h>
Public Member Functions | |
| DescriptorScriptPubKeyMan (WalletStorage &storage, WalletDescriptor &descriptor) | |
| DescriptorScriptPubKeyMan (WalletStorage &storage, bool internal) | |
| util::Result< CTxDestination > | GetNewDestination (const OutputType type) override |
| isminetype | IsMine (const CScript &script) const override |
| bool | CheckDecryptionKey (const CKeyingMaterial &master_key, bool accept_no_keys=false) override |
| Check that the given decryption key is valid for this ScriptPubKeyMan, i.e. More... | |
| bool | Encrypt (const CKeyingMaterial &master_key, WalletBatch *batch) override |
| bool | GetReservedDestination (const OutputType type, bool internal, CTxDestination &address, int64_t &index, CKeyPool &keypool) override |
| void | ReturnDestination (int64_t index, bool internal, const CTxDestination &addr) override |
| bool | TopUp (unsigned int size=0) override |
| Fills internal address pool. More... | |
| void | MarkUnusedAddresses (const CScript &script) override |
| Mark unused addresses as being used. More... | |
| bool | IsHDEnabled () const override |
| bool | SetupDescriptorGeneration (const CExtKey &master_key, OutputType addr_type) |
| Setup descriptors based on the given CExtkey. More... | |
| bool | HavePrivateKeys () const override |
| int64_t | GetOldestKeyPoolTime () const override |
| size_t | KeypoolCountExternalKeys () 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 |
| Returns true if the wallet can give out new addresses. More... | |
| 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... | |
| bool | SignTransaction (CMutableTransaction &tx, const std::map< COutPoint, Coin > &coins, SigHashType sighash, std::map< int, std::string > &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, SigHashType sighash_type=SigHashType().withForkId(), bool sign=true, bool bip32derivs=false) const override |
| Adds script and derivation path information to a PSBT, and optionally signs it. More... | |
| uint256 | GetID () const override |
| void | SetInternal (bool internal) override |
| void | SetCache (const DescriptorCache &cache) |
| bool | AddKey (const CKeyID &key_id, const CKey &key) |
| bool | AddCryptedKey (const CKeyID &key_id, const CPubKey &pubkey, const std::vector< uint8_t > &crypted_key) |
| bool | HasWalletDescriptor (const WalletDescriptor &desc) const |
| void | UpdateWalletDescriptor (WalletDescriptor &descriptor) |
| bool | CanUpdateToWalletDescriptor (const WalletDescriptor &descriptor, std::string &error) |
| void | AddDescriptorKey (const CKey &key, const CPubKey &pubkey) |
| void | WriteDescriptor () |
| WalletDescriptor | GetWalletDescriptor () const EXCLUSIVE_LOCKS_REQUIRED(cs_desc_man) |
| std::vector< CScript > | GetScriptPubKeys () const |
Public Member Functions inherited from ScriptPubKeyMan | |
| ScriptPubKeyMan (WalletStorage &storage) | |
| virtual | ~ScriptPubKeyMan () |
| virtual util::Result< CTxDestination > | GetNewDestination (const OutputType type) |
| virtual isminetype | IsMine (const CScript &script) const |
| virtual bool | CheckDecryptionKey (const CKeyingMaterial &master_key, bool accept_no_keys=false) |
| Check that the given decryption key is valid for this ScriptPubKeyMan, i.e. More... | |
| virtual bool | Encrypt (const CKeyingMaterial &master_key, WalletBatch *batch) |
| virtual bool | GetReservedDestination (const OutputType type, bool internal, CTxDestination &address, int64_t &index, CKeyPool &keypool) |
| 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 void | MarkUnusedAddresses (const CScript &script) |
| Mark unused addresses as being used. More... | |
| virtual bool | SetupGeneration (bool force=false) |
| Sets up the key generation stuff, i.e. More... | |
| virtual bool | IsHDEnabled () const |
| virtual bool | CanGetAddresses (bool internal=false) const |
| Returns true if the wallet can give out new addresses. More... | |
| virtual bool | Upgrade (int prev_version, bilingual_str &error) |
| Upgrades the wallet to the specified version. More... | |
| virtual bool | HavePrivateKeys () const |
| virtual void | RewriteDB () |
| The action to do when the DB needs rewrite. More... | |
| virtual int64_t | GetOldestKeyPoolTime () const |
| virtual size_t | KeypoolCountExternalKeys () 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, SigHashType sighash, std::map< int, std::string > &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, SigHashType sighash_type=SigHashType().withForkId(), bool sign=true, bool bip32derivs=false) const |
| Adds script and derivation path information to a PSBT, and optionally signs it. More... | |
| virtual uint256 | GetID () const |
| virtual void | SetInternal (bool internal) |
| template<typename... Params> | |
| void | WalletLogPrintf (std::string fmt, Params... parameters) const |
| Prepends the wallet name in logging output to ease debugging in multi-wallet use cases. More... | |
Public Attributes | |
| RecursiveMutex | cs_desc_man |
Public Attributes inherited from ScriptPubKeyMan | |
| boost::signals2::signal< void(bool fHaveWatchOnly)> | NotifyWatchonlyChanged |
| Watch-only address added. More... | |
| boost::signals2::signal< void()> | NotifyCanGetAddressesChanged |
| Keypool has new keys. More... | |
Private Types | |
| using | ScriptPubKeyMap = std::map< CScript, int32_t > |
| using | PubKeyMap = std::map< CPubKey, int32_t > |
| using | CryptedKeyMap = std::map< CKeyID, std::pair< CPubKey, std::vector< uint8_t > > > |
| using | KeyMap = std::map< CKeyID, CKey > |
Private Member Functions | |
| WalletDescriptor m_wallet_descriptor | GUARDED_BY (cs_desc_man) |
| 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) |
| 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 (const CPubKey &pubkey) const |
| std::unique_ptr< FlatSigningProvider > | GetSigningProvider (int32_t index, bool include_private=false) const EXCLUSIVE_LOCKS_REQUIRED(cs_desc_man) |
Private Attributes | |
| int32_t | m_max_cached_index = -1 |
| bool | m_internal = false |
| bool | m_decryption_thoroughly_checked = false |
| keeps track of whether Unlock has run a thorough check before More... | |
Additional Inherited Members | |
Protected Attributes inherited from ScriptPubKeyMan | |
| WalletStorage & | m_storage |
Definition at line 652 of file scriptpubkeyman.h.
|
private |
Definition at line 660 of file scriptpubkeyman.h.
|
private |
Definition at line 662 of file scriptpubkeyman.h.
|
private |
Definition at line 659 of file scriptpubkeyman.h.
|
private |
Definition at line 657 of file scriptpubkeyman.h.
|
inline |
Definition at line 698 of file scriptpubkeyman.h.
|
inline |
Definition at line 701 of file scriptpubkeyman.h.
| bool DescriptorScriptPubKeyMan::AddCryptedKey | ( | const CKeyID & | key_id, |
| const CPubKey & | pubkey, | ||
| const std::vector< uint8_t > & | crypted_key | ||
| ) |
Definition at line 2332 of file scriptpubkeyman.cpp.
|
private |
Definition at line 1945 of file scriptpubkeyman.cpp.
Definition at line 2326 of file scriptpubkeyman.cpp.
|
overridevirtual |
Returns true if the wallet can give out new addresses.
This means it has keys in the keypool or can generate new keys.
Reimplemented from ScriptPubKeyMan.
Definition at line 2047 of file scriptpubkeyman.cpp.
|
overridevirtual |
Whether this ScriptPubKeyMan can provide a SigningProvider (via GetSolvingProvider) that, combined with sigdata, can produce solving data.
Reimplemented from ScriptPubKeyMan.
Definition at line 2146 of file scriptpubkeyman.cpp.
| bool DescriptorScriptPubKeyMan::CanUpdateToWalletDescriptor | ( | const WalletDescriptor & | descriptor, |
| std::string & | error | ||
| ) |
Definition at line 2391 of file scriptpubkeyman.cpp.
|
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 ScriptPubKeyMan.
Definition at line 1697 of file scriptpubkeyman.cpp.
|
overridevirtual |
Reimplemented from ScriptPubKeyMan.
Definition at line 1734 of file scriptpubkeyman.cpp.
|
overridevirtual |
Adds script and derivation path information to a PSBT, and optionally signs it.
Reimplemented from ScriptPubKeyMan.
Definition at line 2190 of file scriptpubkeyman.cpp.
|
overridevirtual |
Reimplemented from ScriptPubKeyMan.
Definition at line 2275 of file scriptpubkeyman.cpp.
|
overridevirtual |
Reimplemented from ScriptPubKeyMan.
Definition at line 2077 of file scriptpubkeyman.cpp.
Definition at line 1783 of file scriptpubkeyman.cpp.
|
overridevirtual |
Reimplemented from ScriptPubKeyMan.
Definition at line 2256 of file scriptpubkeyman.cpp.
|
overridevirtual |
Reimplemented from ScriptPubKeyMan.
Definition at line 1634 of file scriptpubkeyman.cpp.
|
overridevirtual |
Reimplemented from ScriptPubKeyMan.
Definition at line 2063 of file scriptpubkeyman.cpp.
|
overridevirtual |
Reimplemented from ScriptPubKeyMan.
Definition at line 1757 of file scriptpubkeyman.cpp.
| std::vector< CScript > DescriptorScriptPubKeyMan::GetScriptPubKeys | ( | ) | const |
Definition at line 2366 of file scriptpubkeyman.cpp.
|
private |
|
private |
Definition at line 2088 of file scriptpubkeyman.cpp.
|
private |
|
overridevirtual |
Reimplemented from ScriptPubKeyMan.
Definition at line 2142 of file scriptpubkeyman.cpp.
|
overridevirtual |
Reimplemented from ScriptPubKeyMan.
Definition at line 2082 of file scriptpubkeyman.cpp.
| WalletDescriptor DescriptorScriptPubKeyMan::GetWalletDescriptor | ( | ) | const |
Definition at line 2362 of file scriptpubkeyman.cpp.
|
private |
|
private |
|
private |
|
private |
|
private |
| bool DescriptorScriptPubKeyMan::HasWalletDescriptor | ( | const WalletDescriptor & | desc | ) | const |
|
overridevirtual |
Reimplemented from ScriptPubKeyMan.
Definition at line 2058 of file scriptpubkeyman.cpp.
|
overridevirtual |
Reimplemented from ScriptPubKeyMan.
Definition at line 2042 of file scriptpubkeyman.cpp.
|
overridevirtual |
Reimplemented from ScriptPubKeyMan.
Definition at line 1689 of file scriptpubkeyman.cpp.
|
overridevirtual |
Reimplemented from ScriptPubKeyMan.
Definition at line 2070 of file scriptpubkeyman.cpp.
|
overridevirtual |
Mark unused addresses as being used.
Reimplemented from ScriptPubKeyMan.
Definition at line 1918 of file scriptpubkeyman.cpp.
|
overridevirtual |
Reimplemented from ScriptPubKeyMan.
Definition at line 1771 of file scriptpubkeyman.cpp.
| void DescriptorScriptPubKeyMan::SetCache | ( | const DescriptorCache & | cache | ) |
Definition at line 2289 of file scriptpubkeyman.cpp.
|
overridevirtual |
Reimplemented from ScriptPubKeyMan.
Definition at line 2285 of file scriptpubkeyman.cpp.
| bool DescriptorScriptPubKeyMan::SetupDescriptorGeneration | ( | const CExtKey & | master_key, |
| OutputType | addr_type | ||
| ) |
Setup descriptors based on the given CExtkey.
Definition at line 1980 of file scriptpubkeyman.cpp.
|
overridevirtual |
Sign a message with the given script.
Reimplemented from ScriptPubKeyMan.
Definition at line 2169 of file scriptpubkeyman.cpp.
|
overridevirtual |
Creates new signatures and adds them to the transaction.
Returns whether all inputs were signed
Reimplemented from ScriptPubKeyMan.
Definition at line 2151 of file scriptpubkeyman.cpp.
|
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 ScriptPubKeyMan.
Definition at line 1803 of file scriptpubkeyman.cpp.
| void DescriptorScriptPubKeyMan::UpdateWalletDescriptor | ( | WalletDescriptor & | descriptor | ) |
| void DescriptorScriptPubKeyMan::WriteDescriptor | ( | ) |
|
mutable |
Definition at line 704 of file scriptpubkeyman.h.
|
private |
keeps track of whether Unlock has run a thorough check before
Definition at line 674 of file scriptpubkeyman.h.
|
private |
Definition at line 668 of file scriptpubkeyman.h.
|
private |
Definition at line 666 of file scriptpubkeyman.h.