Skip to content

Commit fa33d97

Browse files
author
MarcoFalke
committed
[walletdb] Add missing LOCK() in Recover() for dummyWallet
1 parent fa14d99 commit fa33d97

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

src/wallet/walletdb.cpp

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -960,8 +960,13 @@ bool CWalletDB::Recover(CDBEnv& dbenv, const std::string& filename, bool fOnlyKe
960960
CDataStream ssKey(row.first, SER_DISK, CLIENT_VERSION);
961961
CDataStream ssValue(row.second, SER_DISK, CLIENT_VERSION);
962962
string strType, strErr;
963-
bool fReadOK = ReadKeyValue(&dummyWallet, ssKey, ssValue,
963+
bool fReadOK;
964+
{
965+
// Required in LoadKeyMetadata():
966+
LOCK(dummyWallet.cs_wallet);
967+
fReadOK = ReadKeyValue(&dummyWallet, ssKey, ssValue,
964968
wss, strType, strErr);
969+
}
965970
if (!IsKeyType(strType))
966971
continue;
967972
if (!fReadOK)

0 commit comments

Comments
 (0)