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

source

pub fn new<'a>(storage: &'a mut dyn WalletStorage) -> Self

source

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

source§

fn can_get_addresses(&self, internal: Option<bool>) -> bool

| Returns true if the wallet can give out | new addresses. This means it has keys | in the keypool or can generate new keys |

source§

impl CanProvide for ScriptPubKeyMan

source§

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

source§

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

source§

fn encrypt( &mut self, master_key: &KeyingMaterial, batch: *mut WalletBatch ) -> bool

source§

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

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

source§

impl GetID for ScriptPubKeyMan

source§

fn getid(&self) -> u256

source§

impl GetKeyPoolSize for ScriptPubKeyMan

source§

impl GetMetadata for ScriptPubKeyMan

source§

impl GetNewDestination for ScriptPubKeyMan

source§

fn get_new_destination( &mut self, ty: OutputType, dest: &mut TxDestination, error: &mut BilingualStr ) -> bool

source§

impl GetOldestKeyPoolTime for ScriptPubKeyMan

source§

impl GetReservedDestination for ScriptPubKeyMan

source§

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

source§

impl GetTimeFirstKey for ScriptPubKeyMan

source§

impl HavePrivateKeys for ScriptPubKeyMan

source§

impl IsHDEnabled for ScriptPubKeyMan

source§

fn is_hd_enabled(&self) -> bool

| Returns true if HD is enabled |

source§

impl IsMine for ScriptPubKeyMan

source§

fn is_mine(&self, script: &Script) -> IsMineType

source§

impl KeepDestination for ScriptPubKeyMan

source§

fn keep_destination(&mut self, index: i64, ty: &OutputType)

source§

impl MarkUnusedAddresses for ScriptPubKeyMan

source§

fn mark_unused_addresses(&mut self, script: &Script)

| Mark unused addresses as being used |

source§

impl ReturnDestination for ScriptPubKeyMan

source§

fn return_destination( &mut self, index: i64, internal: bool, addr: &TxDestination )

source§

impl RewriteDB for ScriptPubKeyMan

source§

fn rewritedb(&mut self)

| The action to do when the DB needs rewrite |

source§

impl SetupGeneration for ScriptPubKeyMan

source§

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

source§

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

source§

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

source§

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 |

source§

impl Upgrade for ScriptPubKeyMan

source§

fn upgrade( &mut self, prev_version: i32, new_version: i32, error: &mut BilingualStr ) -> bool

| Upgrades the wallet to the specified | version |

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for Twhere T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for Twhere T: ?Sized,

const: unstable · source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere T: ?Sized,

const: unstable · source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
§

impl<T, U> CastInto<U> for Twhere U: CastFrom<T>,

§

unsafe fn cast_into(self) -> U

Performs the conversion. Read more
source§

impl<T> From<T> for T

const: unstable · source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for Twhere U: From<T>,

const: unstable · source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

§

impl<T> Pointable for T

§

const ALIGN: usize = mem::align_of::<T>()

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
§

impl<T> StaticUpcast<T> for T

§

unsafe fn static_upcast(ptr: Ptr<T>) -> Ptr<T>

Convert type of a const pointer. Read more
source§

impl<T, U> TryFrom<U> for Twhere U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
const: unstable · source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
const: unstable · source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for Twhere V: MultiLane<T>,

§

fn vzip(self) -> V