Struct bitcoin_scriptpubkeyman::ScriptPubKeyMan
source · pub struct ScriptPubKeyMan { /* private fields */ }
Expand description
| A class implementing ScriptPubKeyMan | manages some (or all) scriptPubKeys | used in a wallet. | | It contains the scripts and keys related | to the scriptPubKeys it manages. | | A ScriptPubKeyMan will be able to give | out scriptPubKeys to be used, as well | as marking when a scriptPubKey has been | used. It also handles when and how to | store a scriptPubKey and its related | scripts and keys, including encryption. |
Implementations§
source§impl ScriptPubKeyMan
impl ScriptPubKeyMan
pub fn new<'a>(storage: &'a mut dyn WalletStorage) -> Self
sourcepub fn wallet_log_printf<Params>(&self, fmt: String, parameters: Params)
pub fn wallet_log_printf<Params>(&self, fmt: String, parameters: Params)
| Prepends the wallet name in logging | output to ease debugging in multi-wallet | use cases |
Trait Implementations§
source§impl CanGetAddresses for ScriptPubKeyMan
impl CanGetAddresses for ScriptPubKeyMan
source§impl CanProvide for ScriptPubKeyMan
impl CanProvide for ScriptPubKeyMan
source§fn can_provide(&mut self, script: &Script, sigdata: &mut SignatureData) -> bool
fn can_provide(&mut self, script: &Script, sigdata: &mut SignatureData) -> bool
| Whether this ScriptPubKeyMan can provide | a SigningProvider (via GetSolvingProvider) | that, combined with sigdata, can produce | solving data. |
source§impl CheckDecryptionKey for ScriptPubKeyMan
impl CheckDecryptionKey for ScriptPubKeyMan
source§fn check_decryption_key(
&mut self,
master_key: &KeyingMaterial,
accept_no_keys: Option<bool>
) -> bool
fn check_decryption_key( &mut self, master_key: &KeyingMaterial, accept_no_keys: Option<bool> ) -> bool
| Check that the given decryption key | is valid for this ScriptPubKeyMan, | i.e. it decrypts all of the keys handled | by it. |
source§impl Encrypt for ScriptPubKeyMan
impl Encrypt for ScriptPubKeyMan
fn encrypt( &mut self, master_key: &KeyingMaterial, batch: *mut WalletBatch ) -> bool
source§impl FillPSBT for ScriptPubKeyMan
impl FillPSBT for ScriptPubKeyMan
source§fn fill_psbt(
&self,
psbt: &mut PartiallySignedTransaction,
txdata: &PrecomputedTransactionData,
sighash_type: Option<i32>,
sign: Option<bool>,
bip_32derivs: Option<bool>,
n_signed: Option<*mut i32>
) -> TransactionError
fn fill_psbt( &self, psbt: &mut PartiallySignedTransaction, txdata: &PrecomputedTransactionData, sighash_type: Option<i32>, sign: Option<bool>, bip_32derivs: Option<bool>, n_signed: Option<*mut i32> ) -> TransactionError
| Adds script and derivation path information | to a PSBT, and optionally signs it. |
source§impl GetKeyPoolSize for ScriptPubKeyMan
impl GetKeyPoolSize for ScriptPubKeyMan
fn get_key_pool_size(&self) -> u32
source§impl GetMetadata for ScriptPubKeyMan
impl GetMetadata for ScriptPubKeyMan
fn get_metadata(&self, dest: &TxDestination) -> Box<KeyMetadata>
source§impl GetNewDestination for ScriptPubKeyMan
impl GetNewDestination for ScriptPubKeyMan
fn get_new_destination( &mut self, ty: OutputType, dest: &mut TxDestination, error: &mut BilingualStr ) -> bool
source§impl GetOldestKeyPoolTime for ScriptPubKeyMan
impl GetOldestKeyPoolTime for ScriptPubKeyMan
fn get_oldest_key_pool_time(&self) -> i64
source§impl GetReservedDestination for ScriptPubKeyMan
impl GetReservedDestination for ScriptPubKeyMan
fn get_reserved_destination( &mut self, ty: OutputType, internal: bool, address: &mut TxDestination, index: &mut i64, keypool: &mut KeyPool, error: &mut BilingualStr ) -> bool
source§impl GetSolvingProvider for ScriptPubKeyMan
impl GetSolvingProvider for ScriptPubKeyMan
fn get_solving_provider(&self, script: &Script) -> Box<SigningProvider>
source§impl GetTimeFirstKey for ScriptPubKeyMan
impl GetTimeFirstKey for ScriptPubKeyMan
fn get_time_first_key(&self) -> i64
source§impl HavePrivateKeys for ScriptPubKeyMan
impl HavePrivateKeys for ScriptPubKeyMan
fn have_private_keys(&self) -> bool
source§impl IsHDEnabled for ScriptPubKeyMan
impl IsHDEnabled for ScriptPubKeyMan
source§fn is_hd_enabled(&self) -> bool
fn is_hd_enabled(&self) -> bool
| Returns true if HD is enabled |
source§impl IsMine for ScriptPubKeyMan
impl IsMine for ScriptPubKeyMan
fn is_mine(&self, script: &Script) -> IsMineType
source§impl KeepDestination for ScriptPubKeyMan
impl KeepDestination for ScriptPubKeyMan
fn keep_destination(&mut self, index: i64, ty: &OutputType)
source§impl MarkUnusedAddresses for ScriptPubKeyMan
impl MarkUnusedAddresses for ScriptPubKeyMan
source§fn mark_unused_addresses(&mut self, script: &Script)
fn mark_unused_addresses(&mut self, script: &Script)
| Mark unused addresses as being used |
source§impl ReturnDestination for ScriptPubKeyMan
impl ReturnDestination for ScriptPubKeyMan
fn return_destination( &mut self, index: i64, internal: bool, addr: &TxDestination )
source§impl RewriteDB for ScriptPubKeyMan
impl RewriteDB for ScriptPubKeyMan
source§impl SetupGeneration for ScriptPubKeyMan
impl SetupGeneration for ScriptPubKeyMan
source§fn setup_generation(&mut self, force: Option<bool>) -> bool
fn setup_generation(&mut self, force: Option<bool>) -> bool
| Sets up the key generation stuff, i.e. | generates new HD seeds and sets them | as active. | | Returns false if already setup or setup | fails, true if setup is successful | | Set force=true to make it re-setup if | already setup, used for upgrades |
source§impl SignMessage for ScriptPubKeyMan
impl SignMessage for ScriptPubKeyMan
source§fn sign_message(
&self,
message: &String,
pkhash: &PKHash,
str_sig: &mut String
) -> SigningResult
fn sign_message( &self, message: &String, pkhash: &PKHash, str_sig: &mut String ) -> SigningResult
| Sign a message with the given script |
source§impl SignTransaction for ScriptPubKeyMan
impl SignTransaction for ScriptPubKeyMan
source§fn sign_transaction(
&self,
tx: &mut MutableTransaction,
coins: &HashMap<OutPoint, Coin>,
sighash: i32,
input_errors: &mut HashMap<i32, BilingualStr>
) -> bool
fn sign_transaction( &self, tx: &mut MutableTransaction, coins: &HashMap<OutPoint, Coin>, sighash: i32, input_errors: &mut HashMap<i32, BilingualStr> ) -> bool
| Creates new signatures and adds them | to the transaction. Returns whether | all inputs were signed |
source§impl TopUp for ScriptPubKeyMan
impl TopUp for ScriptPubKeyMan
source§fn top_up(&mut self, size: Option<u32>) -> bool
fn top_up(&mut self, size: Option<u32>) -> bool
| 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 |