Skip to content

Commit

Permalink
wallet: CWalletDB CDB composition not inheritance
Browse files Browse the repository at this point in the history
CWalletDB now contains a CDB instead of inheriting from it.

This makes it easier to replace the internal transaction with a different
database, without leaking through internals.
  • Loading branch information
laanwj authored and furszy committed Jan 18, 2021
1 parent f40006a commit 2132f42
Show file tree
Hide file tree
Showing 3 changed files with 133 additions and 94 deletions.
4 changes: 2 additions & 2 deletions src/wallet/db.h
Original file line number Diff line number Diff line change
Expand Up @@ -145,10 +145,10 @@ class CDB
bool fFlushOnClose;
CDBEnv *env;

public:
explicit CDB(CWalletDBWrapper& dbw, const char* pszMode = "r+", bool fFlushOnCloseIn=true);
~CDB() { Close(); }

public:
void Flush();
void Close();
static bool Recover(const std::string& filename, void *callbackDataIn, bool (*recoverKVcallback)(void* callbackData, CDataStream ssKey, CDataStream ssValue));
Expand All @@ -165,7 +165,7 @@ class CDB
CDB(const CDB&);
void operator=(const CDB&);

protected:
public:
template <typename K, typename T>
bool Read(const K& key, T& value)
{
Expand Down
Loading

0 comments on commit 2132f42

Please sign in to comment.