Changeset View
Changeset View
Standalone View
Standalone View
src/wallet/db.h
Show First 20 Lines • Show All 154 Lines • ▼ Show 20 Lines | public: | ||||
virtual void ReloadDbEnv() = 0; | virtual void ReloadDbEnv() = 0; | ||||
std::atomic<unsigned int> nUpdateCounter; | std::atomic<unsigned int> nUpdateCounter; | ||||
unsigned int nLastSeen; | unsigned int nLastSeen; | ||||
unsigned int nLastFlushed; | unsigned int nLastFlushed; | ||||
int64_t nLastWalletUpdate; | int64_t nLastWalletUpdate; | ||||
/** Verifies the environment and database file */ | |||||
virtual bool Verify(bilingual_str &error) = 0; | |||||
std::string m_file_path; | std::string m_file_path; | ||||
/** Make a DatabaseBatch connected to this database */ | /** Make a DatabaseBatch connected to this database */ | ||||
virtual std::unique_ptr<DatabaseBatch> | virtual std::unique_ptr<DatabaseBatch> | ||||
MakeBatch(const char *mode = "r+", bool flush_on_close = true) = 0; | MakeBatch(const char *mode = "r+", bool flush_on_close = true) = 0; | ||||
}; | }; | ||||
/** RAII class that provides access to a DummyDatabase. Never fails. */ | /** RAII class that provides access to a DummyDatabase. Never fails. */ | ||||
Show All 35 Lines | public: | ||||
void RemoveRef() override {} | void RemoveRef() override {} | ||||
bool Rewrite(const char *pszSkip = nullptr) override { return true; } | bool Rewrite(const char *pszSkip = nullptr) override { return true; } | ||||
bool Backup(const std::string &strDest) const override { return true; } | bool Backup(const std::string &strDest) const override { return true; } | ||||
void Close() override {} | void Close() override {} | ||||
void Flush() override {} | void Flush() override {} | ||||
bool PeriodicFlush() override { return true; } | bool PeriodicFlush() override { return true; } | ||||
void IncrementUpdateCounter() override { ++nUpdateCounter; } | void IncrementUpdateCounter() override { ++nUpdateCounter; } | ||||
void ReloadDbEnv() override {} | void ReloadDbEnv() override {} | ||||
bool Verify(bilingual_str &errorStr) override { return true; } | |||||
std::unique_ptr<DatabaseBatch> | std::unique_ptr<DatabaseBatch> | ||||
MakeBatch(const char *mode = "r+", bool flush_on_close = true) override { | MakeBatch(const char *mode = "r+", bool flush_on_close = true) override { | ||||
return std::make_unique<DummyBatch>(); | return std::make_unique<DummyBatch>(); | ||||
} | } | ||||
}; | }; | ||||
enum class DatabaseFormat { | enum class DatabaseFormat { | ||||
BERKELEY, | BERKELEY, | ||||
Show All 28 Lines |