aboutsummaryrefslogtreecommitdiff
path: root/src/wallet/db.h
diff options
context:
space:
mode:
authorIvan Metlushko <metlushko@gmail.com>2020-10-12 17:10:10 +0700
committerIvan Metlushko <metlushko@gmail.com>2020-10-13 18:42:59 +0700
commit135afa749c6e835ea33b8678cdb35da9640eede8 (patch)
tree04a0d10cb618dd2365ae5cb1c4404234b70f4c2f /src/wallet/db.h
parentaf22322dab1a2277483b2512723491a5fad1a606 (diff)
downloadbitcoin-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/db.h')
-rw-r--r--src/wallet/db.h8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/wallet/db.h b/src/wallet/db.h
index 617ed46141..0004fc1afa 100644
--- a/src/wallet/db.h
+++ b/src/wallet/db.h
@@ -108,7 +108,7 @@ public:
virtual ~WalletDatabase() {};
/** Open the database if it is not already opened. */
- virtual void Open(const char* mode) = 0;
+ virtual void Open() = 0;
//! Counts the number of active database users to be sure that the database is not closed while someone is using it
std::atomic<int> m_refcount{0};
@@ -149,7 +149,7 @@ public:
int64_t nLastWalletUpdate;
/** Make a DatabaseBatch connected to this database */
- virtual std::unique_ptr<DatabaseBatch> MakeBatch(const char* mode = "r+", bool flush_on_close = true) = 0;
+ virtual std::unique_ptr<DatabaseBatch> MakeBatch(bool flush_on_close = true) = 0;
};
/** RAII class that provides access to a DummyDatabase. Never fails. */
@@ -178,7 +178,7 @@ public:
class DummyDatabase : public WalletDatabase
{
public:
- void Open(const char* mode) override {};
+ void Open() override {};
void AddRef() override {}
void RemoveRef() override {}
bool Rewrite(const char* pszSkip=nullptr) override { return true; }
@@ -189,7 +189,7 @@ public:
void IncrementUpdateCounter() override { ++nUpdateCounter; }
void ReloadDbEnv() override {}
std::string Filename() override { return "dummy"; }
- std::unique_ptr<DatabaseBatch> MakeBatch(const char* mode = "r+", bool flush_on_close = true) override { return MakeUnique<DummyBatch>(); }
+ std::unique_ptr<DatabaseBatch> MakeBatch(bool flush_on_close = true) override { return MakeUnique<DummyBatch>(); }
};
enum class DatabaseFormat {