Bitcoin Core  0.20.99
P2P Digital Currency
Classes | Namespaces | Functions | Variables
walletdb.cpp File Reference
#include <wallet/walletdb.h>
#include <fs.h>
#include <key_io.h>
#include <protocol.h>
#include <serialize.h>
#include <sync.h>
#include <util/bip32.h>
#include <util/system.h>
#include <util/time.h>
#include <util/translation.h>
#include <wallet/bdb.h>
#include <wallet/sqlite.h>
#include <wallet/wallet.h>
#include <atomic>
#include <string>
Include dependency graph for walletdb.cpp:

Go to the source code of this file.

Classes

class  CWalletScanState
 

Namespaces

 DBKeys
 

Functions

static bool ReadKeyValue (CWallet *pwallet, CDataStream &ssKey, CDataStream &ssValue, CWalletScanState &wss, std::string &strType, std::string &strErr, const KeyFilterFn &filter_fn=nullptr) EXCLUSIVE_LOCKS_REQUIRED(pwallet -> cs_wallet)
 
bool ReadKeyValue (CWallet *pwallet, CDataStream &ssKey, CDataStream &ssValue, std::string &strType, std::string &strErr, const KeyFilterFn &filter_fn)
 Unserialize a given Key-Value pair and load it into the wallet. More...
 
void MaybeCompactWalletDB ()
 Compacts BDB state so that wallet.dat is self-contained (if there are changes) More...
 
std::unique_ptr< WalletDatabaseMakeDatabase (const fs::path &path, const DatabaseOptions &options, DatabaseStatus &status, bilingual_str &error)
 
std::unique_ptr< WalletDatabaseCreateDummyWalletDatabase ()
 Return object for accessing dummy database with no read/write capabilities. More...
 
std::unique_ptr< WalletDatabaseCreateMockWalletDatabase ()
 Return object for accessing temporary in-memory database. More...
 

Variables

const std::string DBKeys::ACENTRY {"acentry"}
 
const std::string DBKeys::ACTIVEEXTERNALSPK {"activeexternalspk"}
 
const std::string DBKeys::ACTIVEINTERNALSPK {"activeinternalspk"}
 
const std::string DBKeys::BESTBLOCK_NOMERKLE {"bestblock_nomerkle"}
 
const std::string DBKeys::BESTBLOCK {"bestblock"}
 
const std::string DBKeys::CRYPTED_KEY {"ckey"}
 
const std::string DBKeys::CSCRIPT {"cscript"}
 
const std::string DBKeys::DEFAULTKEY {"defaultkey"}
 
const std::string DBKeys::DESTDATA {"destdata"}
 
const std::string DBKeys::FLAGS {"flags"}
 
const std::string DBKeys::HDCHAIN {"hdchain"}
 
const std::string DBKeys::KEYMETA {"keymeta"}
 
const std::string DBKeys::KEY {"key"}
 
const std::string DBKeys::MASTER_KEY {"mkey"}
 
const std::string DBKeys::MINVERSION {"minversion"}
 
const std::string DBKeys::NAME {"name"}
 
const std::string DBKeys::OLD_KEY {"wkey"}
 
const std::string DBKeys::ORDERPOSNEXT {"orderposnext"}
 
const std::string DBKeys::POOL {"pool"}
 
const std::string DBKeys::PURPOSE {"purpose"}
 
const std::string DBKeys::SETTINGS {"settings"}
 
const std::string DBKeys::TX {"tx"}
 
const std::string DBKeys::VERSION {"version"}
 
const std::string DBKeys::WALLETDESCRIPTOR {"walletdescriptor"}
 
const std::string DBKeys::WALLETDESCRIPTORCACHE {"walletdescriptorcache"}
 
const std::string DBKeys::WALLETDESCRIPTORCKEY {"walletdescriptorckey"}
 
const std::string DBKeys::WALLETDESCRIPTORKEY {"walletdescriptorkey"}
 
const std::string DBKeys::WATCHMETA {"watchmeta"}
 
const std::string DBKeys::WATCHS {"watchs"}
 

Function Documentation

◆ CreateDummyWalletDatabase()

std::unique_ptr<WalletDatabase> CreateDummyWalletDatabase ( )

Return object for accessing dummy database with no read/write capabilities.

Definition at line 1059 of file walletdb.cpp.

Here is the caller graph for this function:

◆ CreateMockWalletDatabase()

std::unique_ptr<WalletDatabase> CreateMockWalletDatabase ( )

Return object for accessing temporary in-memory database.

Definition at line 1065 of file walletdb.cpp.

Here is the caller graph for this function:

◆ MakeDatabase()

std::unique_ptr<WalletDatabase> MakeDatabase ( const fs::path &  path,
const DatabaseOptions options,
DatabaseStatus status,
bilingual_str error 
)

Definition at line 999 of file walletdb.cpp.

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

◆ MaybeCompactWalletDB()

void MaybeCompactWalletDB ( )

Compacts BDB state so that wallet.dat is self-contained (if there are changes)

Definition at line 936 of file walletdb.cpp.

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

◆ ReadKeyValue() [1/2]

static bool ReadKeyValue ( CWallet pwallet,
CDataStream ssKey,
CDataStream ssValue,
CWalletScanState wss,
std::string &  strType,
std::string &  strErr,
const KeyFilterFn filter_fn = nullptr 
) -> cs_wallet)
static

Definition at line 268 of file walletdb.cpp.

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

◆ ReadKeyValue() [2/2]

bool ReadKeyValue ( CWallet pwallet,
CDataStream ssKey,
CDataStream ssValue,
std::string &  strType,
std::string &  strErr,
const KeyFilterFn filter_fn 
)

Unserialize a given Key-Value pair and load it into the wallet.

Definition at line 678 of file walletdb.cpp.

Here is the call graph for this function: