Bitcoin ABC 0.30.7
P2P Digital Currency
Classes | Namespaces | Typedefs | Enumerations | Functions | Variables
walletdb.h File Reference
#include <key.h>
#include <script/sign.h>
#include <script/standard.h>
#include <wallet/bdb.h>
#include <wallet/walletutil.h>
#include <cstdint>
#include <string>
#include <vector>
Include dependency graph for walletdb.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

class  CHDChain
 
class  CKeyMetadata
 
class  WalletBatch
 Access to the wallet database. More...
 

Namespaces

namespace  DBKeys
 

Typedefs

using KeyFilterFn = std::function< bool(const std::string &)>
 Callback for filtering key types to deserialize in ReadKeyValue. More...
 

Enumerations

enum class  DBErrors {
  LOAD_OK , CORRUPT , NONCRITICAL_ERROR , TOO_NEW ,
  LOAD_FAIL , NEED_REWRITE
}
 Error statuses for the wallet database. More...
 

Functions

void MaybeCompactWalletDB ()
 Compacts BDB state so that wallet.dat is self-contained (if there are changes) More...
 
bool ReadKeyValue (CWallet *pwallet, CDataStream &ssKey, CDataStream &ssValue, std::string &strType, std::string &strErr, const KeyFilterFn &filter_fn=nullptr)
 Unserialize a given Key-Value pair and load it into the wallet. More...
 
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

static const bool DEFAULT_FLUSHWALLET = true
 Overview of wallet database classes: More...
 

Typedef Documentation

◆ KeyFilterFn

using KeyFilterFn = std::function<bool(const std::string &)>

Callback for filtering key types to deserialize in ReadKeyValue.

Definition at line 295 of file walletdb.h.

Enumeration Type Documentation

◆ DBErrors

enum class DBErrors
strong

Error statuses for the wallet database.

Enumerator
LOAD_OK 
CORRUPT 
NONCRITICAL_ERROR 
TOO_NEW 
LOAD_FAIL 
NEED_REWRITE 

Definition at line 45 of file walletdb.h.

Function Documentation

◆ CreateDummyWalletDatabase()

std::unique_ptr< WalletDatabase > CreateDummyWalletDatabase ( )

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

Definition at line 1170 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 1175 of file walletdb.cpp.

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 1050 of file walletdb.cpp.

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

◆ ReadKeyValue()

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

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

Definition at line 760 of file walletdb.cpp.

Here is the call graph for this function:

Variable Documentation

◆ DEFAULT_FLUSHWALLET

const bool DEFAULT_FLUSHWALLET = true
static

Overview of wallet database classes:

  • WalletBatch is an abstract modifier object for the wallet database, and encapsulates a database batch update as well as methods to act on the database. It should be agnostic to the database implementation.

The following classes are implementation specific:

Definition at line 33 of file walletdb.h.