Bitcoin Core 28.99.0
P2P Digital Currency
|
An instance of this class represents one database. More...
#include <db.h>
Public Member Functions | |
WalletDatabase () | |
Create dummy DB handle. More... | |
virtual | ~WalletDatabase ()=default |
virtual void | Open ()=0 |
Open the database if it is not already opened. More... | |
virtual void | AddRef ()=0 |
Indicate the a new database user has began using the database. More... | |
virtual void | RemoveRef ()=0 |
Indicate that database user has stopped using the database and that it could be flushed or closed. More... | |
virtual bool | Rewrite (const char *pszSkip=nullptr)=0 |
Rewrite the entire database on disk, with the exception of key pszSkip if non-zero. More... | |
virtual bool | Backup (const std::string &strDest) const =0 |
Back up the entire database to a file. More... | |
virtual void | Flush ()=0 |
Make sure all changes are flushed to database file. More... | |
virtual void | Close ()=0 |
Flush to the database file and close the database. More... | |
virtual bool | PeriodicFlush ()=0 |
virtual void | IncrementUpdateCounter ()=0 |
virtual void | ReloadDbEnv ()=0 |
virtual std::string | Filename ()=0 |
Return path to main database file for logs and error messages. More... | |
virtual std::string | Format ()=0 |
virtual std::unique_ptr< DatabaseBatch > | MakeBatch (bool flush_on_close=true)=0 |
Make a DatabaseBatch connected to this database. More... | |
Public Attributes | |
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 {0} |
unsigned int | nLastFlushed {0} |
int64_t | nLastWalletUpdate {0} |
|
inline |
|
virtualdefault |
|
pure virtual |
Indicate the a new database user has began using the database.
Increments m_refcount
Implemented in wallet::BerkeleyDatabase, wallet::BerkeleyRODatabase, wallet::DummyDatabase, wallet::SQLiteDatabase, and wallet::MockableDatabase.
|
pure virtual |
Back up the entire database to a file.
Implemented in wallet::SQLiteDatabase, wallet::BerkeleyDatabase, wallet::BerkeleyRODatabase, wallet::DummyDatabase, and wallet::MockableDatabase.
|
pure virtual |
Flush to the database file and close the database.
Also close the environment if no other databases are open in it.
Implemented in wallet::BerkeleyDatabase, wallet::BerkeleyRODatabase, wallet::DummyDatabase, wallet::SQLiteDatabase, and wallet::MockableDatabase.
|
pure virtual |
Return path to main database file for logs and error messages.
Implemented in wallet::BerkeleyDatabase, wallet::BerkeleyRODatabase, wallet::DummyDatabase, wallet::SQLiteDatabase, and wallet::MockableDatabase.
|
pure virtual |
Make sure all changes are flushed to database file.
Implemented in wallet::BerkeleyDatabase, wallet::BerkeleyRODatabase, wallet::DummyDatabase, wallet::SQLiteDatabase, and wallet::MockableDatabase.
|
pure virtual |
Implemented in wallet::BerkeleyDatabase, wallet::BerkeleyRODatabase, wallet::DummyDatabase, wallet::SQLiteDatabase, and wallet::MockableDatabase.
|
pure virtual |
Implemented in wallet::BerkeleyDatabase, wallet::BerkeleyRODatabase, wallet::DummyDatabase, wallet::SQLiteDatabase, and wallet::MockableDatabase.
|
pure virtual |
Make a DatabaseBatch connected to this database.
Implemented in wallet::BerkeleyDatabase, wallet::BerkeleyRODatabase, wallet::DummyDatabase, wallet::SQLiteDatabase, and wallet::MockableDatabase.
|
pure virtual |
Open the database if it is not already opened.
Implemented in wallet::BerkeleyDatabase, wallet::BerkeleyRODatabase, wallet::DummyDatabase, wallet::SQLiteDatabase, and wallet::MockableDatabase.
|
pure virtual |
Implemented in wallet::BerkeleyDatabase, wallet::BerkeleyRODatabase, wallet::DummyDatabase, wallet::SQLiteDatabase, and wallet::MockableDatabase.
|
pure virtual |
Implemented in wallet::BerkeleyDatabase, wallet::BerkeleyRODatabase, wallet::DummyDatabase, wallet::SQLiteDatabase, and wallet::MockableDatabase.
|
pure virtual |
Indicate that database user has stopped using the database and that it could be flushed or closed.
Decrement m_refcount
Implemented in wallet::BerkeleyDatabase, wallet::BerkeleyRODatabase, wallet::DummyDatabase, wallet::SQLiteDatabase, and wallet::MockableDatabase.
|
pure virtual |
Rewrite the entire database on disk, with the exception of key pszSkip if non-zero.
Implemented in wallet::BerkeleyDatabase, wallet::BerkeleyRODatabase, wallet::DummyDatabase, wallet::MockableDatabase, and wallet::SQLiteDatabase.
std::atomic<int> wallet::WalletDatabase::m_refcount {0} |
std::atomic<unsigned int> wallet::WalletDatabase::nUpdateCounter |