Changeset View
Changeset View
Standalone View
Standalone View
src/wallet/db.h
Show First 20 Lines • Show All 214 Lines • ▼ Show 20 Lines | public: | ||||
void ReloadDbEnv() override {} | void ReloadDbEnv() override {} | ||||
bool Verify(bilingual_str &errorStr) override { return true; } | 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 { | |||||
BERKELEY, | |||||
}; | |||||
struct DatabaseOptions { | |||||
bool require_existing = false; | |||||
bool require_create = false; | |||||
bool verify = true; | |||||
}; | |||||
enum class DatabaseStatus { | |||||
SUCCESS, | |||||
FAILED_BAD_PATH, | |||||
FAILED_BAD_FORMAT, | |||||
FAILED_ALREADY_LOADED, | |||||
FAILED_ALREADY_EXISTS, | |||||
FAILED_NOT_FOUND, | |||||
FAILED_VERIFY, | |||||
}; | |||||
std::unique_ptr<WalletDatabase> MakeDatabase(const fs::path &path, | |||||
const DatabaseOptions &options, | |||||
DatabaseStatus &status, | |||||
bilingual_str &error); | |||||
#endif // BITCOIN_WALLET_DB_H | #endif // BITCOIN_WALLET_DB_H |