aboutsummaryrefslogtreecommitdiff
path: root/src/wallet/db.h
diff options
context:
space:
mode:
authorJonas Schnelli <dev@jonasschnelli.ch>2016-08-24 09:57:23 +0200
committerJonas Schnelli <dev@jonasschnelli.ch>2017-03-06 11:30:24 +0100
commit7184e25c80aa8b1629a700bb7a7e290ad0bb2792 (patch)
treec197d4a5d4145703614f86c004aec164068d25f2 /src/wallet/db.h
parentfa625b078b018b5edf9833a602a002538ee83a45 (diff)
[Wallet] refactor CWallet/CWalletDB/CDB
Try to hide CDB/bitdb behinde CWalletDB. Prepare for full wallet database abstraction.
Diffstat (limited to 'src/wallet/db.h')
-rw-r--r--src/wallet/db.h11
1 files changed, 10 insertions, 1 deletions
diff --git a/src/wallet/db.h b/src/wallet/db.h
index b4ce044e7f..19c54e314c 100644
--- a/src/wallet/db.h
+++ b/src/wallet/db.h
@@ -56,7 +56,7 @@ public:
enum VerifyResult { VERIFY_OK,
RECOVER_OK,
RECOVER_FAIL };
- VerifyResult Verify(const std::string& strFile, bool (*recoverFunc)(CDBEnv& dbenv, const std::string& strFile));
+ VerifyResult Verify(const std::string& strFile, bool (*recoverFunc)(const std::string& strFile));
/**
* Salvage data from a file that Verify says is bad.
* fAggressive sets the DB_AGGRESSIVE flag (see berkeley DB->verify() method documentation).
@@ -104,6 +104,15 @@ protected:
public:
void Flush();
void Close();
+ static bool Recover(const std::string& filename, void *callbackDataIn, bool (*recoverKVcallback)(void* callbackData, CDataStream ssKey, CDataStream ssValue));
+
+ /* flush the wallet passively (TRY_LOCK)
+ ideal to be called periodically */
+ static bool PeriodicFlush(std::string strFile);
+ /* verifies the database environment */
+ static bool VerifyEnvironment(const std::string& walletFile, const boost::filesystem::path& dataDir, std::string& errorStr);
+ /* verifies the database file */
+ static bool VerifyDatabaseFile(const std::string& walletFile, const boost::filesystem::path& dataDir, std::string& warningStr, std::string& errorStr, bool (*recoverFunc)(const std::string& strFile));
private:
CDB(const CDB&);