[#wallet-WalletBatch]
= xref:wallet.adoc[wallet]::WalletBatch
:relfileprefix: ../
:mrdocs:

Access to the wallet database&period; Opens the database and provides read and write access to it&period; Each read and write is its own transaction&period; 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&period; Optionally (on by default) it will flush to disk on close&period; Every 1000 writes will automatically trigger a flush to disk&period;

== Synopsis

Declared in `&lt;wallet&sol;walletdb&period;h&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
class WalletBatch;
----

== Member Functions

[cols="1,4"]
|===
| Name| Description
| xref:wallet/WalletBatch/2constructor-0e.adoc[`WalletBatch`]         [.small]#[constructor]#
| Constructors
| xref:wallet/WalletBatch/operator_assign.adoc[`operator&equals;`]  [.small]#[deleted]#
| Wallet batches are non&hyphen;copyable&period;
| xref:wallet/WalletBatch/EraseActiveScriptPubKeyMan.adoc[`EraseActiveScriptPubKeyMan`] 
| Removes the active ScriptPubKeyMan record for a key type&period;
| xref:wallet/WalletBatch/EraseAddressData.adoc[`EraseAddressData`] 
| Erases all destination data for an address&period;
| xref:wallet/WalletBatch/EraseAddressReceiveRequest.adoc[`EraseAddressReceiveRequest`] 
| Erases a receive request associated with an address&period;
| xref:wallet/WalletBatch/EraseLockedUTXO.adoc[`EraseLockedUTXO`] 
| Removes the locked mark from an output&period;
| xref:wallet/WalletBatch/EraseMasterKey.adoc[`EraseMasterKey`] 
| Erases the master key with the given id&period;
| xref:wallet/WalletBatch/EraseName.adoc[`EraseName`] 
| Erases the address book label for an address&period;
| xref:wallet/WalletBatch/ErasePurpose.adoc[`ErasePurpose`] 
| Erases the purpose string for an address&period;
| xref:wallet/WalletBatch/EraseRecords.adoc[`EraseRecords`] 
| Delete records of the given types
| xref:wallet/WalletBatch/EraseTx.adoc[`EraseTx`] 
| Erases the wallet transaction with the given txid&period;
| xref:wallet/WalletBatch/HasActiveTxn.adoc[`HasActiveTxn`] 
| Returns whether a database transaction is currently active&period;
| xref:wallet/WalletBatch/IsEncrypted.adoc[`IsEncrypted`] 
| Returns true if the wallet stores encryption keys&period;
| xref:wallet/WalletBatch/LoadWallet.adoc[`LoadWallet`] 
| Loads the wallet contents from the database into the given wallet&period;
| xref:wallet/WalletBatch/ReadBestBlock.adoc[`ReadBestBlock`] 
| Reads the best block locator scanned by the wallet&period;
| xref:wallet/WalletBatch/RegisterTxnListener.adoc[`RegisterTxnListener`] 
| Registers db txn callback functions
| xref:wallet/WalletBatch/TxnAbort.adoc[`TxnAbort`] 
| Abort current transaction
| xref:wallet/WalletBatch/TxnBegin.adoc[`TxnBegin`] 
| Begin a new transaction
| xref:wallet/WalletBatch/TxnCommit.adoc[`TxnCommit`] 
| Commit current transaction
| xref:wallet/WalletBatch/WriteActiveScriptPubKeyMan.adoc[`WriteActiveScriptPubKeyMan`] 
| Records the active ScriptPubKeyMan for a key type&period;
| xref:wallet/WalletBatch/WriteAddressPreviouslySpent.adoc[`WriteAddressPreviouslySpent`] 
| Records whether an address has previously been spent from&period;
| xref:wallet/WalletBatch/WriteAddressReceiveRequest.adoc[`WriteAddressReceiveRequest`] 
| Writes a receive request associated with an address&period;
| xref:wallet/WalletBatch/WriteBestBlock.adoc[`WriteBestBlock`] 
| Writes the best block locator scanned by the wallet&period;
| xref:wallet/WalletBatch/WriteCryptedDescriptorKey.adoc[`WriteCryptedDescriptorKey`] 
| Writes an encrypted descriptor private key&period;
| xref:wallet/WalletBatch/WriteCryptedKey.adoc[`WriteCryptedKey`] 
| Writes an encrypted private key and its metadata&period;
| xref:wallet/WalletBatch/WriteDescriptor.adoc[`WriteDescriptor`] 
| Writes a wallet descriptor&period;
| xref:wallet/WalletBatch/WriteDescriptorCacheItems.adoc[`WriteDescriptorCacheItems`] 
| Writes all cache items for a descriptor&period;
| xref:wallet/WalletBatch/WriteDescriptorDerivedCache.adoc[`WriteDescriptorDerivedCache`] 
| Writes a derived extended public key into a descriptor&apos;s cache&period;
| xref:wallet/WalletBatch/WriteDescriptorKey.adoc[`WriteDescriptorKey`] 
| Writes an unencrypted descriptor private key&period;
| xref:wallet/WalletBatch/WriteDescriptorLastHardenedCache.adoc[`WriteDescriptorLastHardenedCache`] 
| Writes the last hardened extended public key into a descriptor&apos;s cache&period;
| xref:wallet/WalletBatch/WriteDescriptorParentCache.adoc[`WriteDescriptorParentCache`] 
| Writes a parent extended public key into a descriptor&apos;s cache&period;
| xref:wallet/WalletBatch/WriteKey.adoc[`WriteKey`] 
| Writes an unencrypted private key and its metadata&period;
| xref:wallet/WalletBatch/WriteKeyMetadata.adoc[`WriteKeyMetadata`] 
| Writes metadata for a key&period;
| xref:wallet/WalletBatch/WriteLockedUTXO.adoc[`WriteLockedUTXO`] 
| Marks an output as locked in the wallet&period;
| xref:wallet/WalletBatch/WriteMasterKey.adoc[`WriteMasterKey`] 
| Writes a master key used to encrypt wallet keys&period;
| xref:wallet/WalletBatch/WriteName.adoc[`WriteName`] 
| Writes the address book label for an address&period;
| xref:wallet/WalletBatch/WriteOrderPosNext.adoc[`WriteOrderPosNext`] 
| Writes the next available transaction ordering position&period;
| xref:wallet/WalletBatch/WritePurpose.adoc[`WritePurpose`] 
| Writes the purpose string for an address&period;
| xref:wallet/WalletBatch/WriteTx.adoc[`WriteTx`] 
| Writes a wallet transaction record&period;
| xref:wallet/WalletBatch/WriteVersion.adoc[`WriteVersion`] 
| Write the given `client&lowbar;version` to m&lowbar;batch, indicating the last version of client software to load this wallet&period;
| xref:wallet/WalletBatch/WriteWalletFlags.adoc[`WriteWalletFlags`] 
| Writes the wallet flags&period;
| xref:wallet/WalletBatch/WriteWatchOnly.adoc[`WriteWatchOnly`] 
| Writes a watch&hyphen;only script and its metadata&period;
| xref:wallet/WalletBatch/WriteWtxVariant.adoc[`WriteWtxVariant`] 
| Writes a wallet transaction variant record&period;
|===



[.small]#Created with https://www.mrdocs.com[MrDocs]#
