diff options
author | Andrew Chow <achow101-github@achow101.com> | 2020-06-15 16:54:58 -0400 |
---|---|---|
committer | Andrew Chow <achow101-github@achow101.com> | 2020-07-09 11:43:54 -0400 |
commit | b82f0ca4d5465b36debb6c57f335bdccf4899c49 (patch) | |
tree | e4e0912cc3cc9d43de8308964e31b9ad2b18b928 /src/wallet/bdb.h | |
parent | eac9200814fa01da6522625be01dded730b26751 (diff) | |
download | bitcoin-b82f0ca4d5465b36debb6c57f335bdccf4899c49.tar.xz |
walletdb: Add MakeBatch function to BerkeleyDatabase and use it
Instead of having WalletBatch construct the BerkeleyBatch, have
BerkeleyDatabase do it and return a std::unique_ptr<BerkeleyBatch>
Diffstat (limited to 'src/wallet/bdb.h')
-rw-r--r-- | src/wallet/bdb.h | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/src/wallet/bdb.h b/src/wallet/bdb.h index f3b1e5d0a3..b565bfc680 100644 --- a/src/wallet/bdb.h +++ b/src/wallet/bdb.h @@ -93,6 +93,8 @@ std::shared_ptr<BerkeleyEnvironment> GetWalletEnv(const fs::path& wallet_path, s /** Return wheter a BDB wallet database is currently loaded. */ bool IsBDBWalletLoaded(const fs::path& wallet_path); +class BerkeleyBatch; + /** An instance of this class represents one database. * For BerkeleyDB this is just a (env, strFile) tuple. **/ @@ -161,6 +163,9 @@ public: /** Database pointer. This is initialized lazily and reset during flushes, so it can be null. */ std::unique_ptr<Db> m_db; + /** Make a BerkeleyBatch connected to this database */ + std::unique_ptr<BerkeleyBatch> MakeBatch(const char* mode, bool flush_on_close); + private: std::string strFile; |