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

source

pub fn writeic<K, T>( &mut self, key: &K, value: &T, overwrite: Option<bool> ) -> bool

source

pub fn eraseic<K>(&mut self, key: &K) -> bool

source

pub fn new(database: &mut WalletDatabase, flush_on_close: Option<bool>) -> Self

source

pub fn write_name(&mut self, str_address: &str, str_name: &str) -> bool

source

pub fn erase_name(&mut self, str_address: &String) -> bool

source

pub fn write_purpose( &mut self, str_address: &String, str_purpose: &String ) -> bool

source

pub fn erase_purpose(&mut self, str_address: &String) -> bool

source

pub fn write_tx(&mut self, wtx: &WalletTx) -> bool

source

pub fn erase_tx(&mut self, hash: u256) -> bool

source

pub fn write_key_metadata( &mut self, meta: &KeyMetadata, pubkey: &PubKey, overwrite: bool ) -> bool

source

pub fn write_key( &mut self, vch_pub_key: &PubKey, vch_priv_key: &PrivKey, key_meta: &KeyMetadata ) -> bool

source

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

source

pub fn write_master_key(&mut self, nid: u32, k_master_key: &MasterKey) -> bool

source

pub fn write_cscript(&mut self, hash: &u160, redeem_script: &Script) -> bool

source

pub fn write_watch_only( &mut self, dest: &Script, key_meta: &KeyMetadata ) -> bool

source

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

source

pub fn write_best_block(&mut self, locator: &BlockLocator) -> bool

source

pub fn read_best_block(&mut self, locator: &mut BlockLocator) -> bool

source

pub fn write_order_pos_next(&mut self, n_order_pos_next: i64) -> bool

source

pub fn read_pool(&mut self, n_pool: i64, keypool: &mut KeyPool) -> bool

source

pub fn write_pool(&mut self, n_pool: i64, keypool: &KeyPool) -> bool

source

pub fn erase_pool(&mut self, n_pool: i64) -> bool

source

pub fn write_min_version(&mut self, n_version: i32) -> bool

source

pub fn write_active_script_pub_key_man( &mut self, ty: u8, id: &u256, internal: bool ) -> bool

source

pub fn erase_active_script_pub_key_man( &mut self, ty: u8, internal: bool ) -> bool

source

pub fn write_descriptor_key( &mut self, desc_id: &u256, pubkey: &PubKey, privkey: &PrivKey ) -> bool

source

pub fn write_crypted_descriptor_key( &mut self, desc_id: &u256, pubkey: &PubKey, secret: &Vec<u8> ) -> bool

source

pub fn write_descriptor( &mut self, desc_id: &u256, descriptor: &WalletDescriptor ) -> bool

source

pub fn write_descriptor_derived_cache( &mut self, xpub: &ExtPubKey, desc_id: &u256, key_exp_index: u32, der_index: u32 ) -> bool

source

pub fn write_descriptor_parent_cache( &mut self, xpub: &ExtPubKey, desc_id: &u256, key_exp_index: u32 ) -> bool

source

pub fn write_descriptor_last_hardened_cache( &mut self, xpub: &ExtPubKey, desc_id: &u256, key_exp_index: u32 ) -> bool

source

pub fn write_descriptor_cache_items( &mut self, desc_id: &u256, cache: &DescriptorCache ) -> bool

source

pub fn write_lockedutxo(&mut self, output: &OutPoint) -> bool

source

pub fn erase_lockedutxo(&mut self, output: &OutPoint) -> bool

source

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 |

source

pub fn load_wallet(&mut self, pwallet: &mut dyn WalletInterface) -> DBErrors

source

pub fn find_wallet_tx( &mut self, tx_hash: &mut Vec<u256>, wtx: &mut LinkedList<WalletTx> ) -> DBErrors

source

pub fn zap_select_tx( &mut self, tx_hash_in: &mut Vec<u256>, tx_hash_out: &mut Vec<u256> ) -> DBErrors

source

pub fn write_dest_data( &mut self, address: &String, key: &String, value: &String ) -> bool

| Write destination data key,value tuple | to database |

source

pub fn erase_dest_data(&mut self, address: &String, key: &String) -> bool

| Erase destination data tuple from wallet | database |

source

pub fn write_hd_chain(&mut self, chain: &HDChain) -> bool

| write the hdchain model (external chain | child index counter) |

source

pub fn write_wallet_flags(&mut self, flags: u64) -> bool

source

pub fn txn_begin(&mut self) -> bool

| Begin a new transaction |

source

pub fn txn_commit(&mut self) -> bool

| Commit current transaction |

source

pub fn txn_abort(&mut self) -> bool

| Abort current transaction |

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