aboutsummaryrefslogtreecommitdiff
path: root/src/wallet/walletdb.cpp
diff options
context:
space:
mode:
authorAndrew Chow <achow101-github@achow101.com>2020-05-15 19:15:50 -0400
committerAndrew Chow <achow101-github@achow101.com>2020-05-25 12:59:29 -0400
commit2741774214168eb287c7066d6823afe5e570381d (patch)
tree237e7fd9da491764d1d4ea2cc84dff370324337e /src/wallet/walletdb.cpp
parentced95d0e43389fe62b5d30fcc7c42dbca0e88242 (diff)
Expose a version of ReadKeyValue and use it in RecoverKeysOnlyFilter
We need this exposed for BerkeleyBatch::Recover to be moved out.
Diffstat (limited to 'src/wallet/walletdb.cpp')
-rw-r--r--src/wallet/walletdb.cpp11
1 files changed, 8 insertions, 3 deletions
diff --git a/src/wallet/walletdb.cpp b/src/wallet/walletdb.cpp
index c0c408e2ec..c04637934d 100644
--- a/src/wallet/walletdb.cpp
+++ b/src/wallet/walletdb.cpp
@@ -588,6 +588,13 @@ ReadKeyValue(CWallet* pwallet, CDataStream& ssKey, CDataStream& ssValue,
return true;
}
+bool ReadKeyValue(CWallet* pwallet, CDataStream& ssKey, CDataStream& ssValue, std::string& strType, std::string& strErr)
+{
+ CWalletScanState dummy_wss;
+ LOCK(pwallet->cs_wallet);
+ return ReadKeyValue(pwallet, ssKey, ssValue, dummy_wss, strType, strErr);
+}
+
bool WalletBatch::IsKeyType(const std::string& strType)
{
return (strType == DBKeys::KEY ||
@@ -896,14 +903,12 @@ bool WalletBatch::Recover(const fs::path& wallet_path, std::string& out_backup_f
bool WalletBatch::RecoverKeysOnlyFilter(void *callbackData, CDataStream ssKey, CDataStream ssValue)
{
CWallet *dummyWallet = reinterpret_cast<CWallet*>(callbackData);
- CWalletScanState dummyWss;
std::string strType, strErr;
bool fReadOK;
{
// Required in LoadKeyMetadata():
LOCK(dummyWallet->cs_wallet);
- fReadOK = ReadKeyValue(dummyWallet, ssKey, ssValue,
- dummyWss, strType, strErr);
+ fReadOK = ReadKeyValue(dummyWallet, ssKey, ssValue, strType, strErr);
}
if (!IsKeyType(strType) && strType != DBKeys::HDCHAIN) {
return false;