wallet::WalletDatabase

An instance of this class represents one database.

Synopsis

Declared in <wallet/db.h>

class WalletDatabase;

Member Functions

NameDescription
WalletDatabase [constructor]Create dummy DB handle
~WalletDatabase [destructor] [virtual]Destroys the database handle.
Backup [virtual]Back up the entire database to a file.
Close [virtual]Flush to the database file and close the database. Also close the environment if no other databases are open in it.
Filename [virtual]Return path to main database file for logs and error messages.
Files [virtual]Return paths to all database created files
Format [virtual]Returns the name of the database format.
MakeBatch [virtual]Make a DatabaseBatch connected to this database
Open [virtual]Open the database if it is not already opened.
Rewrite [virtual]Rewrite the entire database on disk

Data Members

NameDescription
m_refcount Counts the number of active database users to be sure that the database is not closed while someone is using it

Non-Member Functions

NameDescription
MakeDatabaseCreates or opens a wallet database at the given path.
MakeInMemoryWalletDatabaseCreate a new in-memory wallet database.
MakeWalletDatabaseOpen the database backend for a wallet.
RunWithinTxnExecutes the provided function 'func' within a database transaction context.

Derived Classes

NameDescription
BerkeleyRODatabase A class representing a BerkeleyDB file from which we can only read records. This is used only for migration of legacy to descriptor wallets
SQLiteDatabase An instance of this class represents one SQLite3 database.