diff options
author | Ivan Metlushko <metlushko@gmail.com> | 2020-10-12 17:10:10 +0700 |
---|---|---|
committer | Ivan Metlushko <metlushko@gmail.com> | 2020-10-13 18:42:59 +0700 |
commit | 135afa749c6e835ea33b8678cdb35da9640eede8 (patch) | |
tree | 04a0d10cb618dd2365ae5cb1c4404234b70f4c2f /src/wallet/bdb.h | |
parent | af22322dab1a2277483b2512723491a5fad1a606 (diff) | |
download | bitcoin-135afa749c6e835ea33b8678cdb35da9640eede8.tar.xz |
wallet: remove db mode string
We never need to open database in read-only mode as it's controlled
separately for every batch.
Also we can safely create database if it doesn't exist already
because require_existing option is verified in MakeDatabase
before creating a new WalletDatabase instance.
Diffstat (limited to 'src/wallet/bdb.h')
-rw-r--r-- | src/wallet/bdb.h | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/src/wallet/bdb.h b/src/wallet/bdb.h index fd5a49acc3..070590872b 100644 --- a/src/wallet/bdb.h +++ b/src/wallet/bdb.h @@ -109,9 +109,8 @@ public: ~BerkeleyDatabase() override; - /** Open the database if it is not already opened. - * Dummy function, doesn't do anything right now, but is needed for class abstraction */ - void Open(const char* mode) override; + /** Open the database if it is not already opened. */ + void Open() override; /** Rewrite the entire database on disk, with the exception of key pszSkip if non-zero */ @@ -164,7 +163,7 @@ public: std::string strFile; /** Make a BerkeleyBatch connected to this database */ - std::unique_ptr<DatabaseBatch> MakeBatch(const char* mode = "r+", bool flush_on_close = true) override; + std::unique_ptr<DatabaseBatch> MakeBatch(bool flush_on_close = true) override; }; /** RAII class that provides access to a Berkeley database */ @@ -207,7 +206,7 @@ protected: BerkeleyDatabase& m_database; public: - explicit BerkeleyBatch(BerkeleyDatabase& database, const char* pszMode = "r+", bool fFlushOnCloseIn=true); + explicit BerkeleyBatch(BerkeleyDatabase& database, const bool fReadOnly, bool fFlushOnCloseIn=true); ~BerkeleyBatch() override; BerkeleyBatch(const BerkeleyBatch&) = delete; |