Bitcoin Core  0.20.99
P2P Digital Currency
Classes | Functions | Variables
db.h File Reference
#include <clientversion.h>
#include <fs.h>
#include <serialize.h>
#include <streams.h>
#include <util/system.h>
#include <atomic>
#include <map>
#include <memory>
#include <string>
#include <unordered_map>
#include <vector>
#include <db_cxx.h>
Include dependency graph for db.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  WalletDatabaseFileId
 
class  BerkeleyEnvironment
 
class  BerkeleyDatabase
 An instance of this class represents one database. More...
 
class  BerkeleyBatch
 RAII class that provides access to a Berkeley database. More...
 
class  BerkeleyBatch::SafeDbt
 RAII class that automatically cleanses its data on destruction. More...
 

Functions

bool IsWalletLoaded (const fs::path &wallet_path)
 Return whether a wallet database is currently loaded. More...
 
fs::path WalletDataFilePath (const fs::path &wallet_path)
 Given a wallet directory path or legacy file path, return path to main data file in the wallet database. More...
 
std::shared_ptr< BerkeleyEnvironmentGetWalletEnv (const fs::path &wallet_path, std::string &database_filename)
 Get BerkeleyEnvironment and database filename given a wallet path. More...
 
std::string BerkeleyDatabaseVersion ()
 

Variables

static const unsigned int DEFAULT_WALLET_DBLOGSIZE = 100
 
static const bool DEFAULT_WALLET_PRIVDB = true
 

Function Documentation

◆ BerkeleyDatabaseVersion()

std::string BerkeleyDatabaseVersion ( )

Definition at line 767 of file db.cpp.

Here is the caller graph for this function:

◆ GetWalletEnv()

std::shared_ptr<BerkeleyEnvironment> GetWalletEnv ( const fs::path &  wallet_path,
std::string &  database_filename 
)

Get BerkeleyEnvironment and database filename given a wallet path.

Parameters
[in]wallet_pathPath to wallet directory. Or (for backwards compatibility only) a path to a berkeley btree data file inside a wallet directory.
[out]database_filenameFilename of berkeley btree data file inside the wallet directory.
Returns
A shared pointer to the BerkeleyEnvironment object for the wallet directory, never empty because ~BerkeleyEnvironment erases the weak pointer from the g_dbenvs map.
Postcondition
A new BerkeleyEnvironment weak pointer is inserted into g_dbenvs if the directory path key was not already in the map.

Definition at line 99 of file db.cpp.

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

◆ IsWalletLoaded()

bool IsWalletLoaded ( const fs::path &  wallet_path)

Return whether a wallet database is currently loaded.

Definition at line 72 of file db.cpp.

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

◆ WalletDataFilePath()

fs::path WalletDataFilePath ( const fs::path &  wallet_path)

Given a wallet directory path or legacy file path, return path to main data file in the wallet database.

Definition at line 84 of file db.cpp.

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

Variable Documentation

◆ DEFAULT_WALLET_DBLOGSIZE

const unsigned int DEFAULT_WALLET_DBLOGSIZE = 100
static

Definition at line 33 of file db.h.

◆ DEFAULT_WALLET_PRIVDB

const bool DEFAULT_WALLET_PRIVDB = true
static

Definition at line 34 of file db.h.