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

Go to the source code of this file.

Classes

struct  wallet::LoadResult
 

Namespaces

 wallet
 
 wallet::DBKeys
 

Typedefs

using wallet::LoadFunc = std::function< DBErrors(CWallet *pwallet, DataStream &key, DataStream &value, std::string &err)>
 

Functions

bool wallet::LoadKey (CWallet *pwallet, DataStream &ssKey, DataStream &ssValue, std::string &strErr)
 
bool wallet::LoadCryptedKey (CWallet *pwallet, DataStream &ssKey, DataStream &ssValue, std::string &strErr)
 
bool wallet::LoadEncryptionKey (CWallet *pwallet, DataStream &ssKey, DataStream &ssValue, std::string &strErr)
 
bool wallet::LoadHDChain (CWallet *pwallet, DataStream &ssValue, std::string &strErr)
 
static DBErrors wallet::LoadMinVersion (CWallet *pwallet, DatabaseBatch &batch) EXCLUSIVE_LOCKS_REQUIRED(pwallet -> cs_wallet)
 
static DBErrors wallet::LoadWalletFlags (CWallet *pwallet, DatabaseBatch &batch) EXCLUSIVE_LOCKS_REQUIRED(pwallet -> cs_wallet)
 
static LoadResult wallet::LoadRecords (CWallet *pwallet, DatabaseBatch &batch, const std::string &key, DataStream &prefix, LoadFunc load_func)
 
static LoadResult wallet::LoadRecords (CWallet *pwallet, DatabaseBatch &batch, const std::string &key, LoadFunc load_func)
 
static DBErrors wallet::LoadLegacyWalletRecords (CWallet *pwallet, DatabaseBatch &batch, int last_client) EXCLUSIVE_LOCKS_REQUIRED(pwallet -> cs_wallet)
 
template<typename... Args>
static DataStream wallet::PrefixStream (const Args &... args)
 
static DBErrors wallet::LoadDescriptorWalletRecords (CWallet *pwallet, DatabaseBatch &batch, int last_client) EXCLUSIVE_LOCKS_REQUIRED(pwallet -> cs_wallet)
 
static DBErrors wallet::LoadAddressBookRecords (CWallet *pwallet, DatabaseBatch &batch) EXCLUSIVE_LOCKS_REQUIRED(pwallet -> cs_wallet)
 
static DBErrors wallet::LoadTxRecords (CWallet *pwallet, DatabaseBatch &batch, std::vector< uint256 > &upgraded_txs, bool &any_unordered) EXCLUSIVE_LOCKS_REQUIRED(pwallet -> cs_wallet)
 
static DBErrors wallet::LoadActiveSPKMs (CWallet *pwallet, DatabaseBatch &batch) EXCLUSIVE_LOCKS_REQUIRED(pwallet -> cs_wallet)
 
static DBErrors wallet::LoadDecryptionKeys (CWallet *pwallet, DatabaseBatch &batch) EXCLUSIVE_LOCKS_REQUIRED(pwallet -> cs_wallet)
 
static bool wallet::RunWithinTxn (WalletBatch &batch, std::string_view process_desc, const std::function< bool(WalletBatch &)> &func)
 
bool wallet::RunWithinTxn (WalletDatabase &database, std::string_view process_desc, const std::function< bool(WalletBatch &)> &func)
 Executes the provided function 'func' within a database transaction context. More...
 
void wallet::MaybeCompactWalletDB (WalletContext &context)
 Compacts BDB state so that wallet.dat is self-contained (if there are changes) More...
 
std::unique_ptr< WalletDatabase > wallet::MakeDatabase (const fs::path &path, const DatabaseOptions &options, DatabaseStatus &status, bilingual_str &error)
 

Variables

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