aboutsummaryrefslogtreecommitdiff
path: root/src/wallet/walletdb.h
diff options
context:
space:
mode:
authorAndrew Chow <achow101-github@achow101.com>2020-06-15 16:24:00 -0400
committerAndrew Chow <achow101-github@achow101.com>2020-07-14 11:07:16 -0400
commitd416ae560e46a4846a3fd5990b7d390d2ef30ec8 (patch)
tree3e859a51aba093050caabfc31ab873a27c16f39b /src/wallet/walletdb.h
parent2179dbcbcd0b9bef7ad9c907b85294b9a1bccf0f (diff)
downloadbitcoin-d416ae560e46a4846a3fd5990b7d390d2ef30ec8.tar.xz
walletdb: Introduce WalletDatabase abstract class
Make WalletDatabase actually an abstract class and not just a typedef for BerkeleyDatabase. Have BerkeleyDatabase inherit this class.
Diffstat (limited to 'src/wallet/walletdb.h')
-rw-r--r--src/wallet/walletdb.h11
1 files changed, 4 insertions, 7 deletions
diff --git a/src/wallet/walletdb.h b/src/wallet/walletdb.h
index 6b55361c07..7c5bf7652b 100644
--- a/src/wallet/walletdb.h
+++ b/src/wallet/walletdb.h
@@ -40,9 +40,6 @@ class CWalletTx;
class uint160;
class uint256;
-/** Backend-agnostic database type. */
-using WalletDatabase = BerkeleyDatabase;
-
/** Error statuses for the wallet database */
enum class DBErrors
{
@@ -280,7 +277,7 @@ public:
//! Abort current transaction
bool TxnAbort();
private:
- std::unique_ptr<BerkeleyBatch> m_batch;
+ std::unique_ptr<DatabaseBatch> m_batch;
WalletDatabase& m_database;
};
@@ -294,12 +291,12 @@ bool ReadKeyValue(CWallet* pwallet, CDataStream& ssKey, CDataStream& ssValue, st
bool IsWalletLoaded(const fs::path& wallet_path);
/** Return object for accessing database at specified path. */
-std::unique_ptr<BerkeleyDatabase> CreateWalletDatabase(const fs::path& path);
+std::unique_ptr<WalletDatabase> CreateWalletDatabase(const fs::path& path);
/** Return object for accessing dummy database with no read/write capabilities. */
-std::unique_ptr<BerkeleyDatabase> CreateDummyWalletDatabase();
+std::unique_ptr<WalletDatabase> CreateDummyWalletDatabase();
/** Return object for accessing temporary in-memory database. */
-std::unique_ptr<BerkeleyDatabase> CreateMockWalletDatabase();
+std::unique_ptr<WalletDatabase> CreateMockWalletDatabase();
#endif // BITCOIN_WALLET_WALLETDB_H