Struct bitcoinwallet_interface::WalletBatch
source · pub struct WalletBatch { /* private fields */ }Expand description
| Access to the wallet database. | | Opens the database and provides read | and write access to it. Each read and | write is its own transaction. | | Multiple operation transactions can | be started using TxnBegin() and committed | using TxnCommit() | | Otherwise the transaction will be committed | when the object goes out of scope. | | Optionally (on by default) it will flush | to disk on close. | | Every 1000 writes will automatically | trigger a flush to disk. |
Implementations§
source§impl WalletBatch
impl WalletBatch
pub fn writeic<K, T>(
&mut self,
key: &K,
value: &T,
overwrite: Option<bool>
) -> bool
pub fn eraseic<K>(&mut self, key: &K) -> bool
pub fn new(database: &mut WalletDatabase, flush_on_close: Option<bool>) -> Self
pub fn write_name(&mut self, str_address: &str, str_name: &str) -> bool
pub fn erase_name(&mut self, str_address: &String) -> bool
pub fn write_purpose(
&mut self,
str_address: &String,
str_purpose: &String
) -> bool
pub fn erase_purpose(&mut self, str_address: &String) -> bool
pub fn write_tx(&mut self, wtx: &WalletTx) -> bool
pub fn erase_tx(&mut self, hash: u256) -> bool
pub fn write_key_metadata(
&mut self,
meta: &KeyMetadata,
pubkey: &PubKey,
overwrite: bool
) -> bool
pub fn write_key(
&mut self,
vch_pub_key: &PubKey,
vch_priv_key: &PrivKey,
key_meta: &KeyMetadata
) -> bool
pub fn write_crypted_key(
&mut self,
vch_pub_key: &PubKey,
vch_crypted_secret: &Vec<u8>,
key_meta: &KeyMetadata
) -> bool
pub fn write_master_key(&mut self, nid: u32, k_master_key: &MasterKey) -> bool
pub fn write_cscript(&mut self, hash: &u160, redeem_script: &Script) -> bool
pub fn write_watch_only(&mut self, dest: &Script, key_meta: &KeyMetadata) -> bool
pub fn erase_watch_only(&mut self, dest: &Script) -> bool
pub fn write_best_block(&mut self, locator: &BlockLocator) -> bool
pub fn read_best_block(&mut self, locator: &mut BlockLocator) -> bool
pub fn write_order_pos_next(&mut self, n_order_pos_next: i64) -> bool
pub fn read_pool(&mut self, n_pool: i64, keypool: &mut KeyPool) -> bool
pub fn write_pool(&mut self, n_pool: i64, keypool: &KeyPool) -> bool
pub fn erase_pool(&mut self, n_pool: i64) -> bool
pub fn write_min_version(&mut self, n_version: i32) -> bool
pub fn write_active_script_pub_key_man(
&mut self,
ty: u8,
id: &u256,
internal: bool
) -> bool
pub fn erase_active_script_pub_key_man(&mut self, ty: u8, internal: bool) -> bool
pub fn write_descriptor_key(
&mut self,
desc_id: &u256,
pubkey: &PubKey,
privkey: &PrivKey
) -> bool
pub fn write_crypted_descriptor_key(
&mut self,
desc_id: &u256,
pubkey: &PubKey,
secret: &Vec<u8>
) -> bool
pub fn write_descriptor(
&mut self,
desc_id: &u256,
descriptor: &WalletDescriptor
) -> bool
pub fn write_descriptor_derived_cache(
&mut self,
xpub: &ExtPubKey,
desc_id: &u256,
key_exp_index: u32,
der_index: u32
) -> bool
pub fn write_descriptor_parent_cache(
&mut self,
xpub: &ExtPubKey,
desc_id: &u256,
key_exp_index: u32
) -> bool
pub fn write_descriptor_last_hardened_cache(
&mut self,
xpub: &ExtPubKey,
desc_id: &u256,
key_exp_index: u32
) -> bool
pub fn write_descriptor_cache_items(
&mut self,
desc_id: &u256,
cache: &DescriptorCache
) -> bool
pub fn write_lockedutxo(&mut self, output: &OutPoint) -> bool
pub fn erase_lockedutxo(&mut self, output: &OutPoint) -> bool
sourcepub fn is_key_type(&mut self, str_type: &String) -> bool
pub fn is_key_type(&mut self, str_type: &String) -> bool
| Function to determine if a certain KV/key-type | is a key (cryptographical key) type |
pub fn load_wallet(&mut self, pwallet: &mut dyn WalletInterface) -> DBErrors
pub fn find_wallet_tx(
&mut self,
tx_hash: &mut Vec<u256>,
wtx: &mut LinkedList<WalletTx>
) -> DBErrors
pub fn zap_select_tx(
&mut self,
tx_hash_in: &mut Vec<u256>,
tx_hash_out: &mut Vec<u256>
) -> DBErrors
sourcepub fn write_dest_data(
&mut self,
address: &String,
key: &String,
value: &String
) -> bool
pub fn write_dest_data(
&mut self,
address: &String,
key: &String,
value: &String
) -> bool
| Write destination data key,value tuple | to database |
sourcepub fn erase_dest_data(&mut self, address: &String, key: &String) -> bool
pub fn erase_dest_data(&mut self, address: &String, key: &String) -> bool
| Erase destination data tuple from wallet | database |
sourcepub fn write_hd_chain(&mut self, chain: &HDChain) -> bool
pub fn write_hd_chain(&mut self, chain: &HDChain) -> bool
| write the hdchain model (external chain | child index counter) |
pub fn write_wallet_flags(&mut self, flags: u64) -> bool
sourcepub fn txn_commit(&mut self) -> bool
pub fn txn_commit(&mut self) -> bool
| Commit current transaction |