pub struct LegacyScriptPubKeyMan { /* private fields */ }
Expand description
Implementations§
source§impl LegacyScriptPubKeyMan
impl LegacyScriptPubKeyMan
pub fn get_hd_chain(&self) -> &HDChain
pub fn get_all_reserve_keys(&self) -> &HashMap<KeyID, i64>
pub fn get_new_destination( &mut self, ty: OutputType, dest: &mut TxDestination, error: &mut BilingualStr ) -> bool
pub fn is_mine(&self, script: &Script) -> IsMineType
pub fn check_decryption_key( &mut self, master_key: &KeyingMaterial, accept_no_keys: Option<bool> ) -> bool
pub fn encrypt( &mut self, master_key: &KeyingMaterial, batch: *mut WalletBatch ) -> bool
pub fn get_reserved_destination( &mut self, ty: OutputType, internal: bool, address: &mut TxDestination, index: &mut i64, keypool: &mut KeyPool, error: &mut BilingualStr ) -> bool
sourcepub fn top_up_inactive_hd_chain(
&mut self,
seed_id: KeyID,
index: i64,
internal: bool
) -> bool
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 |
pub fn mark_unused_addresses(&mut self, script: &Script)
sourcepub fn upgrade_key_metadata(&mut self)
pub fn upgrade_key_metadata(&mut self)
| Upgrade stored CKeyMetadata objects | to store key origin info as KeyOriginInfo |
pub fn setup_generation(&mut self, force: Option<bool>) -> bool
pub fn is_hd_enabled(&self) -> bool
pub fn can_get_addresses(&self, internal: Option<bool>) -> bool
pub fn upgrade( &mut self, prev_version: i32, new_version: i32, error: &mut BilingualStr ) -> bool
pub fn have_private_keys(&self) -> bool
pub fn rewritedb(&mut self)
pub fn get_oldest_key_pool_time(&self) -> i64
pub fn keypool_count_external_keys(&self) -> usize
pub fn get_key_pool_size(&self) -> u32
pub fn get_time_first_key(&self) -> i64
pub fn get_solving_provider(&self, script: &Script) -> Box<SigningProvider>
pub fn can_provide( &mut self, script: &Script, sigdata: &mut SignatureData ) -> bool
pub fn sign_transaction( &self, tx: &mut MutableTransaction, coins: &HashMap<OutPoint, Coin>, sighash: i32, input_errors: &mut HashMap<i32, BilingualStr> ) -> bool
pub fn sign_message( &self, message: &String, pkhash: &PKHash, str_sig: &mut String ) -> SigningResult
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
pub fn get_metadata(&self, dest: &TxDestination) -> Box<KeyMetadata>
pub fn getid(&self) -> u256
sourcepub fn update_time_first_key(&mut self, n_create_time: i64)
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. |
sourcepub fn load_key(&mut self, key: &Key, pubkey: &PubKey) -> bool
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) |
sourcepub fn add_key_pub_key(&mut self, secret: &Key, pubkey: &PubKey) -> bool
pub fn add_key_pub_key(&mut self, secret: &Key, pubkey: &PubKey) -> bool
| Adds a key to the store, and saves it to | disk. |
sourcepub fn add_key_pub_key_withdb(
&mut self,
batch: &mut WalletBatch,
secret: &Key,
pubkey: &PubKey
) -> bool
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. |
sourcepub fn load_cscript(&mut self, redeem_script: &Script) -> bool
pub fn load_cscript(&mut self, redeem_script: &Script) -> bool
| Adds a CScript to the store |
sourcepub fn load_key_metadata(&mut self, keyid: &KeyID, meta: &KeyMetadata)
pub fn load_key_metadata(&mut self, keyid: &KeyID, meta: &KeyMetadata)
| Load metadata (used by LoadWallet) |
pub fn load_script_metadata(&mut self, script_id: &ScriptID, meta: &KeyMetadata)
pub fn add_key_pub_key_inner(&mut self, key: &Key, pubkey: &PubKey) -> bool
sourcepub fn load_crypted_key(
&mut self,
vch_pub_key: &PubKey,
vch_crypted_secret: &Vec<u8>,
checksum_valid: bool
) -> bool
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) |
pub fn add_crypted_key_inner( &mut self, vch_pub_key: &PubKey, vch_crypted_secret: &Vec<u8> ) -> bool
sourcepub fn add_crypted_key(
&mut self,
vch_pub_key: &PubKey,
vch_crypted_secret: &Vec<u8>
) -> bool
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. |
sourcepub fn have_watch_only_with_script(&self, dest: &Script) -> bool
pub fn have_watch_only_with_script(&self, dest: &Script) -> bool
| Returns whether the watch-only script | is in the wallet |
sourcepub fn have_watch_only(&self) -> bool
pub fn have_watch_only(&self) -> bool
| Returns whether there are any watch-only | things in the wallet |
sourcepub fn remove_watch_only(&mut self, dest: &Script) -> bool
pub fn remove_watch_only(&mut self, dest: &Script) -> bool
| Remove a watch only script from the keystore |
sourcepub fn load_watch_only(&mut self, dest: &Script) -> bool
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) |
pub fn add_watch_only_in_mem(&mut self, dest: &Script) -> bool
pub fn add_watch_only_withdb( &mut self, batch: &mut WalletBatch, dest: &Script ) -> bool
sourcepub fn add_watch_only_withdb_with_create_time(
&mut self,
batch: &mut WalletBatch,
dest: &Script,
create_time: i64
) -> bool
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. |
sourcepub fn add_watch_only(&mut self, dest: &Script) -> bool
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. |
pub fn add_watch_only_with_create_time( &mut self, dest: &Script, n_create_time: i64 ) -> bool
sourcepub fn load_hd_chain(&mut self, chain: &HDChain)
pub fn load_hd_chain(&mut self, chain: &HDChain)
| Load a HD chain model (used by LoadWallet) |
sourcepub fn add_hd_chain(&mut self, chain: &HDChain)
pub fn add_hd_chain(&mut self, chain: &HDChain)
| Set the HD chain model (chain child index | counters) and writes it to the database |
pub fn add_inactive_hd_chain(&mut self, chain: &HDChain)
pub fn have_key(&self, address: &KeyID) -> bool
pub fn get_key(&self, address: &KeyID, key_out: &mut Key) -> bool
pub fn get_key_origin(&self, keyid: &KeyID, info: &mut KeyOriginInfo) -> bool
sourcepub fn get_watch_pub_key(
&self,
address: &KeyID,
pubkey_out: &mut PubKey
) -> bool
pub fn get_watch_pub_key( &self, address: &KeyID, pubkey_out: &mut PubKey ) -> bool
| Fetches a pubkey from mapWatchKeys | if it exists there |
pub fn get_pub_key(&self, address: &KeyID, vch_pub_key_out: &mut PubKey) -> bool
sourcepub fn generate_new_key(
&mut self,
batch: &mut WalletBatch,
hd_chain: &mut HDChain,
internal: Option<bool>
) -> PubKey
pub fn generate_new_key( &mut self, batch: &mut WalletBatch, hd_chain: &mut HDChain, internal: Option<bool> ) -> PubKey
| Generate a new key |
sourcepub fn derive_new_child_key(
&mut self,
batch: &mut WalletBatch,
metadata: &mut KeyMetadata,
secret: &mut Key,
hd_chain: &mut HDChain,
internal: Option<bool>
)
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) |
sourcepub fn load_key_pool(&mut self, n_index: i64, keypool: &KeyPool)
pub fn load_key_pool(&mut self, n_index: i64, keypool: &KeyPool)
| Load a keypool entry |
sourcepub fn can_generate_keys(&self) -> bool
pub fn can_generate_keys(&self) -> bool
| Returns true if the wallet can generate | new keys |
sourcepub fn generate_new_seed(&mut self) -> PubKey
pub fn generate_new_seed(&mut self) -> PubKey
| Generates a new HD seed (will not be activated) |
sourcepub fn derive_new_seed(&mut self, key: &Key) -> PubKey
pub fn derive_new_seed(&mut self, key: &Key) -> PubKey
| Derives a new HD seed (will not be activated) |
sourcepub fn set_hd_seed(&mut self, seed: &PubKey)
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). |
sourcepub fn new_key_pool(&mut self) -> bool
pub fn new_key_pool(&mut self) -> bool
| Mark old keypool keys as used, and generate | all new keys |
pub fn top_up(&mut self, kp_size: Option<u32>) -> bool
pub fn add_keypool_pubkey_withdb( &mut self, pubkey: &PubKey, internal: bool, batch: &mut WalletBatch )
pub fn keep_destination(&mut self, n_index: i64, ty: &OutputType)
pub fn return_destination( &mut self, n_index: i64, internal: bool, _2: &TxDestination )
sourcepub fn get_key_from_pool(
&mut self,
result: &mut PubKey,
ty: OutputType,
internal: Option<bool>
) -> bool
pub fn get_key_from_pool( &mut self, result: &mut PubKey, ty: OutputType, internal: Option<bool> ) -> bool
| Fetches a key from the keypool |
sourcepub fn reserve_key_from_key_pool(
&mut self,
n_index: &mut i64,
keypool: &mut KeyPool,
requested_internal: bool
) -> bool
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). |
sourcepub fn mark_reserve_keys_as_used(&mut self, keypool_id: i64)
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. |
pub fn mark_pre_split_keys(&mut self)
pub fn add_cscript(&mut self, redeem_script: &Script) -> bool
sourcepub fn add_cscript_withdb(
&mut self,
batch: &mut WalletBatch,
redeem_script: &Script
) -> bool
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 |
sourcepub fn add_key_origin_withdb(
&mut self,
batch: &mut WalletBatch,
pubkey: &PubKey,
info: &KeyOriginInfo
) -> bool
pub fn add_key_origin_withdb( &mut self, batch: &mut WalletBatch, pubkey: &PubKey, info: &KeyOriginInfo ) -> bool
| Add a KeyOriginInfo to the wallet |