Bitcoin Core 31.0.0
P2P Digital Currency
Loading...
Searching...
No Matches
wallet::BerkeleyRODatabase Class Reference

A class representing a BerkeleyDB file from which we can only read records. More...

#include <migrate.h>

Inheritance diagram for wallet::BerkeleyRODatabase:
[legend]
Collaboration diagram for wallet::BerkeleyRODatabase:
[legend]

Public Member Functions

 BerkeleyRODatabase (const fs::path &filepath, bool open=true)
 Create DB handle.
 ~BerkeleyRODatabase ()=default
void Open () override
 Open the database if it is not already opened.
bool Rewrite () override
 Rewrite the entire database on disk.
bool Backup (const std::string &strDest) const override
 Back up the entire database to a file.
void Close () override
 Flush to the database file and close the database.
std::string Filename () override
 Return path to main database file for logs and error messages.
std::vector< fs::pathFiles () override
 Return paths to all database created files.
std::string Format () override
std::unique_ptr< DatabaseBatchMakeBatch () override
 Make a DatabaseBatch connected to this database.
Public Member Functions inherited from wallet::WalletDatabase
 WalletDatabase ()=default
 Create dummy DB handle.
virtual ~WalletDatabase ()=default

Public Attributes

BerkeleyROData m_records
Public Attributes inherited from wallet::WalletDatabase
std::atomic< int > m_refcount {0}
 Counts the number of active database users to be sure that the database is not closed while someone is using it.

Private Attributes

const fs::path m_filepath

Detailed Description

A class representing a BerkeleyDB file from which we can only read records.

This is used only for migration of legacy to descriptor wallets

Definition at line 20 of file migrate.h.

Constructor & Destructor Documentation

◆ BerkeleyRODatabase()

wallet::BerkeleyRODatabase::BerkeleyRODatabase ( const fs::path & filepath,
bool open = true )
inline

Create DB handle.

Definition at line 27 of file migrate.h.

Here is the call graph for this function:

◆ ~BerkeleyRODatabase()

wallet::BerkeleyRODatabase::~BerkeleyRODatabase ( )
default

Member Function Documentation

◆ Backup()

bool wallet::BerkeleyRODatabase::Backup ( const std::string & strDest) const
overridevirtual

Back up the entire database to a file.

Implements wallet::WalletDatabase.

Definition at line 711 of file migrate.cpp.

Here is the call graph for this function:

◆ Close()

void wallet::BerkeleyRODatabase::Close ( )
inlineoverridevirtual

Flush to the database file and close the database.

Also close the environment if no other databases are open in it.

Implements wallet::WalletDatabase.

Definition at line 49 of file migrate.h.

◆ Filename()

std::string wallet::BerkeleyRODatabase::Filename ( )
inlineoverridevirtual

Return path to main database file for logs and error messages.

Implements wallet::WalletDatabase.

Definition at line 52 of file migrate.h.

◆ Files()

std::vector< fs::path > wallet::BerkeleyRODatabase::Files ( )
inlineoverridevirtual

Return paths to all database created files.

Implements wallet::WalletDatabase.

Definition at line 53 of file migrate.h.

◆ Format()

std::string wallet::BerkeleyRODatabase::Format ( )
inlineoverridevirtual

Implements wallet::WalletDatabase.

Definition at line 55 of file migrate.h.

◆ MakeBatch()

std::unique_ptr< DatabaseBatch > wallet::BerkeleyRODatabase::MakeBatch ( )
overridevirtual

Make a DatabaseBatch connected to this database.

Implements wallet::WalletDatabase.

Definition at line 706 of file migrate.cpp.

◆ Open()

void wallet::BerkeleyRODatabase::Open ( )
overridevirtual

Open the database if it is not already opened.

Implements wallet::WalletDatabase.

Definition at line 529 of file migrate.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ Rewrite()

bool wallet::BerkeleyRODatabase::Rewrite ( )
inlineoverridevirtual

Rewrite the entire database on disk.

Implements wallet::WalletDatabase.

Definition at line 40 of file migrate.h.

Member Data Documentation

◆ m_filepath

const fs::path wallet::BerkeleyRODatabase::m_filepath
private

Definition at line 23 of file migrate.h.

◆ m_records

BerkeleyROData wallet::BerkeleyRODatabase::m_records

Definition at line 33 of file migrate.h.


The documentation for this class was generated from the following files: