diff options
author | Andrew Chow <achow101-github@achow101.com> | 2020-05-15 19:24:26 -0400 |
---|---|---|
committer | Andrew Chow <achow101-github@achow101.com> | 2020-05-25 12:59:29 -0400 |
commit | b426c7764d26e280e1f814cf36e050743c45cd12 (patch) | |
tree | 0291aa49cb78fefc8f5428e3f3fd4d662795d79c /src/wallet/walletdb.cpp | |
parent | 2741774214168eb287c7066d6823afe5e570381d (diff) |
Make BerkeleyBatch::Recover and WalletBatch::RecoverKeysOnlyFilter standalone
Instead of having these be class static functions, just make them be
standalone. Also removes WalletBatch::Recover which just passed through
to BerkeleyBatch::Recover.
Diffstat (limited to 'src/wallet/walletdb.cpp')
-rw-r--r-- | src/wallet/walletdb.cpp | 19 |
1 files changed, 2 insertions, 17 deletions
diff --git a/src/wallet/walletdb.cpp b/src/wallet/walletdb.cpp index c04637934d..2a3daf59b4 100644 --- a/src/wallet/walletdb.cpp +++ b/src/wallet/walletdb.cpp @@ -885,22 +885,7 @@ void MaybeCompactWalletDB() fOneThread = false; } -// -// Try to (very carefully!) recover wallet file if there is a problem. -// -bool WalletBatch::Recover(const fs::path& wallet_path, void *callbackDataIn, bool (*recoverKVcallback)(void* callbackData, CDataStream ssKey, CDataStream ssValue), std::string& out_backup_filename) -{ - return BerkeleyBatch::Recover(wallet_path, callbackDataIn, recoverKVcallback, out_backup_filename); -} - -bool WalletBatch::Recover(const fs::path& wallet_path, std::string& out_backup_filename) -{ - // recover without a key filter callback - // results in recovering all record types - return WalletBatch::Recover(wallet_path, nullptr, nullptr, out_backup_filename); -} - -bool WalletBatch::RecoverKeysOnlyFilter(void *callbackData, CDataStream ssKey, CDataStream ssValue) +bool RecoverKeysOnlyFilter(void *callbackData, CDataStream ssKey, CDataStream ssValue) { CWallet *dummyWallet = reinterpret_cast<CWallet*>(callbackData); std::string strType, strErr; @@ -910,7 +895,7 @@ bool WalletBatch::RecoverKeysOnlyFilter(void *callbackData, CDataStream ssKey, C LOCK(dummyWallet->cs_wallet); fReadOK = ReadKeyValue(dummyWallet, ssKey, ssValue, strType, strErr); } - if (!IsKeyType(strType) && strType != DBKeys::HDCHAIN) { + if (!WalletBatch::IsKeyType(strType) && strType != DBKeys::HDCHAIN) { return false; } if (!fReadOK) |