[walletdb] Add missing LOCK() in Recover() for dummyWallet

zcash: cherry picked fa33d9740c9b0d1071094ab6c1736f27a7090c95
zcash: https://github.com/bitcoin/bitcoin/pull/7229
This commit is contained in:
MarcoFalke 2015-12-19 14:26:56 +01:00 committed by Larry Ruane
parent 2713f9680d
commit 4359b3bdcf
1 changed files with 6 additions and 1 deletions

View File

@ -1248,8 +1248,13 @@ bool CWalletDB::Recover(CDBEnv& dbenv, const std::string& filename, bool fOnlyKe
CDataStream ssKey(row.first, SER_DISK, CLIENT_VERSION);
CDataStream ssValue(row.second, SER_DISK, CLIENT_VERSION);
string strType, strErr;
bool fReadOK = ReadKeyValue(&dummyWallet, ssKey, ssValue,
bool fReadOK;
{
// Required in LoadKeyMetadata():
LOCK(dummyWallet.cs_wallet);
fReadOK = ReadKeyValue(&dummyWallet, ssKey, ssValue,
wss, strType, strErr);
}
if (!IsKeyType(strType))
continue;
if (!fReadOK)