mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-12-06 02:33:28 +01:00
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.
This commit is contained in:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user