Bitcoin Core  0.19.99
P2P Digital Currency
Functions | Variables
db.cpp File Reference
#include <wallet/db.h>
#include <util/strencodings.h>
#include <util/translation.h>
#include <stdint.h>
#include <sys/stat.h>
#include <boost/thread.hpp>
Include dependency graph for db.cpp:

Go to the source code of this file.

Functions

static void SplitWalletPath (const fs::path &wallet_path, fs::path &env_directory, std::string &database_filename)
 
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...
 

Variables

static const char * HEADER_END = "HEADER=END"
 
static const char * DATA_END = "DATA=END"
 

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.

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:

◆ SplitWalletPath()

static void SplitWalletPath ( const fs::path &  wallet_path,
fs::path &  env_directory,
std::string &  database_filename 
)
static

Definition at line 56 of file db.cpp.

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

◆ DATA_END

const char* DATA_END = "DATA=END"
static

Definition at line 444 of file db.cpp.

◆ HEADER_END

const char* HEADER_END = "HEADER=END"
static

Definition at line 442 of file db.cpp.