Bitcoin
Classes | Functions | Variables
db.h File Reference
#include <clientversion.h>
#include <fs.h>
#include <serialize.h>
#include <streams.h>
#include <sync.h>
#include <util/system.h>
#include <version.h>
#include <atomic>
#include <map>
#include <memory>
#include <string>
#include <unordered_map>
#include <vector>
#include <db_cxx.h>

Go to the source code of this file.

Classes

struct  WalletDatabaseFileId
 
class  BerkeleyEnvironment
 
class  BerkeleyDatabase
 
class  BerkeleyBatch
 
class  BerkeleyBatch::SafeDbt
 

Functions

bool IsWalletLoaded (const fs::path &wallet_path)
 
fs::path WalletDataFilePath (const fs::path &wallet_path)
 
std::shared_ptr< BerkeleyEnvironmentGetWalletEnv (const fs::path &wallet_path, std::string &database_filename)
 

Variables

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

Function Documentation

◆ 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.

◆ IsWalletLoaded()

bool IsWalletLoaded ( const fs::path &  wallet_path)

Return whether a wallet database is currently loaded.

◆ 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.

Variable Documentation

◆ DEFAULT_WALLET_DBLOGSIZE

const unsigned int DEFAULT_WALLET_DBLOGSIZE = 100
static

◆ DEFAULT_WALLET_PRIVDB

const bool DEFAULT_WALLET_PRIVDB = true
static