pub struct LegacyScriptPubKeyMan { /* private fields */ }
Expand description

Implementations§

source§

impl LegacyScriptPubKeyMan

source

pub fn get_hd_chain(&self) -> &HDChain

source

pub fn get_all_reserve_keys(&self) -> &HashMap<KeyID, i64>

source

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

source

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

source

pub fn check_decryption_key( &mut self, master_key: &KeyingMaterial, accept_no_keys: Option<bool> ) -> bool

source

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

source

pub fn get_reserved_destination( &mut self, ty: OutputType, internal: bool, address: &mut TxDestination, index: &mut i64, keypool: &mut KeyPool, error: &mut BilingualStr ) -> bool

source

pub fn top_up_inactive_hd_chain( &mut self, seed_id: KeyID, index: i64, internal: bool ) -> bool

| Like TopUp() but adds keys for inactive | HD chains. | | Ensures that there are at least -keypool | number of keys derived after the given | index. | | ———– | @param seed_id | | the CKeyID for the HD seed. | ––––– | @param index | | the index to start generating keys from | ––––– | @param internal | | whether the internal chain should be | used. true for internal chain, false | for external chain. | | ———– | @return | | true if seed was found and keys were derived. | false if unable to derive seeds |

source

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

source

pub fn upgrade_key_metadata(&mut self)

| Upgrade stored CKeyMetadata objects | to store key origin info as KeyOriginInfo |

source

pub fn setup_generation(&mut self, force: Option<bool>) -> bool

source

pub fn is_hd_enabled(&self) -> bool

source

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

source

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

source

pub fn have_private_keys(&self) -> bool

source

pub fn rewritedb(&mut self)

source

pub fn get_oldest_key_pool_time(&self) -> i64

source

pub fn keypool_count_external_keys(&self) -> usize

source

pub fn get_key_pool_size(&self) -> u32

source

pub fn get_time_first_key(&self) -> i64

source

pub fn get_solving_provider(&self, script: &Script) -> Box<SigningProvider>

source

pub fn can_provide( &mut self, script: &Script, sigdata: &mut SignatureData ) -> bool

source

pub fn sign_transaction( &self, tx: &mut MutableTransaction, coins: &HashMap<OutPoint, Coin>, sighash: i32, input_errors: &mut HashMap<i32, BilingualStr> ) -> bool

source

pub fn sign_message( &self, message: &String, pkhash: &PKHash, str_sig: &mut String ) -> SigningResult

source

pub fn fillpsbt( &self, psbtx: &mut PartiallySignedTransaction, txdata: &PrecomputedTransactionData, sighash_type: Option<i32>, sign: Option<bool>, bip_32derivs: Option<bool>, n_signed: *mut i32 ) -> TransactionError

source

pub fn get_metadata(&self, dest: &TxDestination) -> Box<KeyMetadata>

source

pub fn getid(&self) -> u256

source

pub fn update_time_first_key(&mut self, n_create_time: i64)

| Update wallet first key creation time. | This should be called whenever keys | are added to the wallet, with the oldest | key creation time. |

source

pub fn load_key(&mut self, key: &Key, pubkey: &PubKey) -> bool

| Adds a key to the store, without saving | it to disk (used by LoadWallet) |

source

pub fn add_key_pub_key(&mut self, secret: &Key, pubkey: &PubKey) -> bool

| Adds a key to the store, and saves it to | disk. |

source

pub fn add_key_pub_key_withdb( &mut self, batch: &mut WalletBatch, secret: &Key, pubkey: &PubKey ) -> bool

| Adds a key to the store, and saves it to | disk. |

source

pub fn load_cscript(&mut self, redeem_script: &Script) -> bool

| Adds a CScript to the store |

source

pub fn load_key_metadata(&mut self, keyid: &KeyID, meta: &KeyMetadata)

| Load metadata (used by LoadWallet) |

source

pub fn load_script_metadata(&mut self, script_id: &ScriptID, meta: &KeyMetadata)

source

pub fn add_key_pub_key_inner(&mut self, key: &Key, pubkey: &PubKey) -> bool

source

pub fn load_crypted_key( &mut self, vch_pub_key: &PubKey, vch_crypted_secret: &Vec<u8>, checksum_valid: bool ) -> bool

| Adds an encrypted key to the store, without | saving it to disk (used by LoadWallet) |

source

pub fn add_crypted_key_inner( &mut self, vch_pub_key: &PubKey, vch_crypted_secret: &Vec<u8> ) -> bool

source

pub fn add_crypted_key( &mut self, vch_pub_key: &PubKey, vch_crypted_secret: &Vec<u8> ) -> bool

| Adds an encrypted key to the store, and | saves it to disk. |

source

pub fn have_watch_only_with_script(&self, dest: &Script) -> bool

| Returns whether the watch-only script | is in the wallet |

source

pub fn have_watch_only(&self) -> bool

| Returns whether there are any watch-only | things in the wallet |

source

pub fn remove_watch_only(&mut self, dest: &Script) -> bool

| Remove a watch only script from the keystore |

source

pub fn load_watch_only(&mut self, dest: &Script) -> bool

| Adds a watch-only address to the store, | without saving it to disk (used by | LoadWallet) |

source

pub fn add_watch_only_in_mem(&mut self, dest: &Script) -> bool

source

pub fn add_watch_only_withdb( &mut self, batch: &mut WalletBatch, dest: &Script ) -> bool

source

pub fn add_watch_only_withdb_with_create_time( &mut self, batch: &mut WalletBatch, dest: &Script, create_time: i64 ) -> bool

| Adds a watch-only address to the store, | and saves it to disk. |

source

pub fn add_watch_only(&mut self, dest: &Script) -> bool

| Private version of AddWatchOnly method | which does not accept a timestamp, and | which will reset the wallet’s nTimeFirstKey | value to 1 if the watch key did not previously | have a timestamp associated with it. | | Because this is an inherited virtual | method, it is accessible despite being | marked private, but it is marked private | anyway to encourage use of the other | AddWatchOnly which accepts a timestamp | and sets nTimeFirstKey more intelligently | for more efficient rescans. |

source

pub fn add_watch_only_with_create_time( &mut self, dest: &Script, n_create_time: i64 ) -> bool

source

pub fn load_hd_chain(&mut self, chain: &HDChain)

| Load a HD chain model (used by LoadWallet) |

source

pub fn add_hd_chain(&mut self, chain: &HDChain)

| Set the HD chain model (chain child index | counters) and writes it to the database |

source

pub fn add_inactive_hd_chain(&mut self, chain: &HDChain)

source

pub fn have_key(&self, address: &KeyID) -> bool

source

pub fn get_key(&self, address: &KeyID, key_out: &mut Key) -> bool

source

pub fn get_key_origin(&self, keyid: &KeyID, info: &mut KeyOriginInfo) -> bool

source

pub fn get_watch_pub_key( &self, address: &KeyID, pubkey_out: &mut PubKey ) -> bool

| Fetches a pubkey from mapWatchKeys | if it exists there |

source

pub fn get_pub_key(&self, address: &KeyID, vch_pub_key_out: &mut PubKey) -> bool

source

pub fn generate_new_key( &mut self, batch: &mut WalletBatch, hd_chain: &mut HDChain, internal: Option<bool> ) -> PubKey

| Generate a new key |

source

pub fn derive_new_child_key( &mut self, batch: &mut WalletBatch, metadata: &mut KeyMetadata, secret: &mut Key, hd_chain: &mut HDChain, internal: Option<bool> )

| HD derive new child key (on internal | or external chain) |

source

pub fn load_key_pool(&mut self, n_index: i64, keypool: &KeyPool)

| Load a keypool entry |

source

pub fn can_generate_keys(&self) -> bool

| Returns true if the wallet can generate | new keys |

source

pub fn generate_new_seed(&mut self) -> PubKey

| Generates a new HD seed (will not be activated) |

source

pub fn derive_new_seed(&mut self, key: &Key) -> PubKey

| Derives a new HD seed (will not be activated) |

source

pub fn set_hd_seed(&mut self, seed: &PubKey)

| Set the current HD seed (will reset the | chain child index counters) | | Sets the seed’s version based on the | current wallet version (so the caller | must ensure the current wallet version | is correct before calling this function). |

source

pub fn new_key_pool(&mut self) -> bool

| Mark old keypool keys as used, and generate | all new keys |

source

pub fn top_up(&mut self, kp_size: Option<u32>) -> bool

source

pub fn add_keypool_pubkey_withdb( &mut self, pubkey: &PubKey, internal: bool, batch: &mut WalletBatch )

source

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

source

pub fn return_destination( &mut self, n_index: i64, internal: bool, _2: &TxDestination )

source

pub fn get_key_from_pool( &mut self, result: &mut PubKey, ty: OutputType, internal: Option<bool> ) -> bool

| Fetches a key from the keypool |

source

pub fn reserve_key_from_key_pool( &mut self, n_index: &mut i64, keypool: &mut KeyPool, requested_internal: bool ) -> bool

| Reserves a key from the keypool and sets | nIndex to its index | | ———– | @param[out] nIndex | | the index of the key in keypool | ––––– | @param[out] keypool | | the keypool the key was drawn from, which | could be the the pre-split pool if present, | or the internal or external pool | ––––– | @param fRequestedInternal | | true if the caller would like the key | drawn from the internal keypool, false | if external is preferred | | ———– | @return | | true if succeeded, false if failed due | to empty keypool @throws std::runtime_error | if keypool read failed, key was invalid, | was not found in the wallet, or was misclassified | in the internal or external keypool |

| Explicitly make the wallet learn the | related scripts for outputs to the given | key. This is purely to make the wallet | file compatible with older software, | as FillableSigningProvider automatically | does this implicitly for all keys now. |

| Same as LearnRelatedScripts, but when | the OutputType is not known (and could | be anything). |

source

pub fn mark_reserve_keys_as_used(&mut self, keypool_id: i64)

| Marks all keys in the keypool up to and | including reserve_key as used. |

source

pub fn mark_pre_split_keys(&mut self)

source

pub fn add_cscript(&mut self, redeem_script: &Script) -> bool

source

pub fn add_cscript_withdb( &mut self, batch: &mut WalletBatch, redeem_script: &Script ) -> bool

| Adds a script to the store and saves it | to disk |

source

pub fn add_key_origin_withdb( &mut self, batch: &mut WalletBatch, pubkey: &PubKey, info: &KeyOriginInfo ) -> bool

| Add a KeyOriginInfo to the wallet |

source

pub fn import_scripts( &mut self, scripts: HashSet<Script>, timestamp: i64 ) -> bool

source

pub fn import_priv_keys( &mut self, privkey_map: &HashMap<KeyID, Key>, timestamp: i64 ) -> bool

source

pub fn import_pub_keys( &mut self, ordered_pubkeys: &Vec<KeyID>, pubkey_map: &HashMap<KeyID, PubKey>, key_origins: &HashMap<KeyID, (PubKey, KeyOriginInfo)>, add_keypool: bool, internal: bool, timestamp: i64 ) -> bool

source

pub fn import_script_pub_keys( &mut self, script_pub_keys: &HashSet<Script>, have_solving_data: bool, timestamp: i64 ) -> bool

source

pub fn get_keys(&self) -> HashSet<KeyID>

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