Bitcoin Core  24.99.0
P2P Digital Currency
Public Member Functions | Public Attributes | List of all members
wallet::FailDatabase Class Reference

A dummy WalletDatabase that does nothing, only fails if needed. More...

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

Public Member Functions

void Open () override
 Open the database if it is not already opened. More...
 
void AddRef () override
 Indicate the a new database user has began using the database. More...
 
void RemoveRef () override
 Indicate that database user has stopped using the database and that it could be flushed or closed. More...
 
bool Rewrite (const char *pszSkip=nullptr) override
 Rewrite the entire database on disk, with the exception of key pszSkip if non-zero. More...
 
bool Backup (const std::string &strDest) const override
 Back up the entire database to a file. More...
 
void Close () override
 Flush to the database file and close the database. More...
 
void Flush () override
 Make sure all changes are flushed to database file. More...
 
bool PeriodicFlush () override
 
void IncrementUpdateCounter () override
 
void ReloadDbEnv () override
 
std::string Filename () override
 Return path to main database file for logs and error messages. More...
 
std::string Format () override
 
std::unique_ptr< DatabaseBatchMakeBatch (bool flush_on_close=true) override
 Make a DatabaseBatch connected to this database. More...
 
- Public Member Functions inherited from wallet::WalletDatabase
 WalletDatabase ()
 Create dummy DB handle. More...
 
virtual ~WalletDatabase ()
 

Public Attributes

bool m_pass {true}
 
- 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. More...
 
std::atomic< unsigned int > nUpdateCounter
 
unsigned int nLastSeen
 
unsigned int nLastFlushed
 
int64_t nLastWalletUpdate
 

Detailed Description

A dummy WalletDatabase that does nothing, only fails if needed.

Definition at line 894 of file wallet_tests.cpp.

Member Function Documentation

◆ AddRef()

void wallet::FailDatabase::AddRef ( )
inlineoverridevirtual

Indicate the a new database user has began using the database.

Increments m_refcount

Implements wallet::WalletDatabase.

Definition at line 900 of file wallet_tests.cpp.

◆ Backup()

bool wallet::FailDatabase::Backup ( const std::string &  strDest) const
inlineoverridevirtual

Back up the entire database to a file.

Implements wallet::WalletDatabase.

Definition at line 903 of file wallet_tests.cpp.

◆ Close()

void wallet::FailDatabase::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 904 of file wallet_tests.cpp.

◆ Filename()

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

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

Implements wallet::WalletDatabase.

Definition at line 909 of file wallet_tests.cpp.

◆ Flush()

void wallet::FailDatabase::Flush ( )
inlineoverridevirtual

Make sure all changes are flushed to database file.

Implements wallet::WalletDatabase.

Definition at line 905 of file wallet_tests.cpp.

◆ Format()

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

Implements wallet::WalletDatabase.

Definition at line 910 of file wallet_tests.cpp.

◆ IncrementUpdateCounter()

void wallet::FailDatabase::IncrementUpdateCounter ( )
inlineoverridevirtual

Implements wallet::WalletDatabase.

Definition at line 907 of file wallet_tests.cpp.

◆ MakeBatch()

std::unique_ptr<DatabaseBatch> wallet::FailDatabase::MakeBatch ( bool  flush_on_close = true)
inlineoverridevirtual

Make a DatabaseBatch connected to this database.

Implements wallet::WalletDatabase.

Definition at line 911 of file wallet_tests.cpp.

◆ Open()

void wallet::FailDatabase::Open ( )
inlineoverridevirtual

Open the database if it is not already opened.

Implements wallet::WalletDatabase.

Definition at line 899 of file wallet_tests.cpp.

◆ PeriodicFlush()

bool wallet::FailDatabase::PeriodicFlush ( )
inlineoverridevirtual

Implements wallet::WalletDatabase.

Definition at line 906 of file wallet_tests.cpp.

◆ ReloadDbEnv()

void wallet::FailDatabase::ReloadDbEnv ( )
inlineoverridevirtual

Implements wallet::WalletDatabase.

Definition at line 908 of file wallet_tests.cpp.

◆ RemoveRef()

void wallet::FailDatabase::RemoveRef ( )
inlineoverridevirtual

Indicate that database user has stopped using the database and that it could be flushed or closed.

Decrement m_refcount

Implements wallet::WalletDatabase.

Definition at line 901 of file wallet_tests.cpp.

◆ Rewrite()

bool wallet::FailDatabase::Rewrite ( const char *  pszSkip = nullptr)
inlineoverridevirtual

Rewrite the entire database on disk, with the exception of key pszSkip if non-zero.

Implements wallet::WalletDatabase.

Definition at line 902 of file wallet_tests.cpp.

Member Data Documentation

◆ m_pass

bool wallet::FailDatabase::m_pass {true}

Definition at line 897 of file wallet_tests.cpp.


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