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.cpp | |
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.cpp')
-rw-r--r-- | src/wallet/bdb.cpp | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/src/wallet/bdb.cpp b/src/wallet/bdb.cpp index 5f823d5906..8992031ba0 100644 --- a/src/wallet/bdb.cpp +++ b/src/wallet/bdb.cpp @@ -841,3 +841,8 @@ bool BerkeleyBatch::HasKey(CDataStream&& key) int ret = pdb->exists(activeTxn, datKey, 0); return ret == 0; } + +std::unique_ptr<BerkeleyBatch> BerkeleyDatabase::MakeBatch(const char* mode, bool flush_on_close) +{ + return MakeUnique<BerkeleyBatch>(*this, mode, flush_on_close); +} |