diff --git a/src/wallet/wallet.cpp b/src/wallet/wallet.cpp index 6d8c78979..26faed52a 100644 --- a/src/wallet/wallet.cpp +++ b/src/wallet/wallet.cpp @@ -887,6 +887,8 @@ bool CWallet::IsSaplingSpent(const uint256& nullifier) const { } unsigned int CWallet::GetSaplingSpendDepth(const uint256& nullifier) const { + LOCK(cs_main); + pair range; range = mapTxSaplingNullifiers.equal_range(nullifier); @@ -977,10 +979,11 @@ void CWallet::ClearNoteWitnessCache() void CWallet::DecrementNoteWitnesses(const CBlockIndex* pindex) { - LOCK2(cs_main, cs_wallet); extern int32_t HUSH_REWIND; + LOCK(cs_wallet); + for (std::pair& wtxItem : mapWallet) { //Sapling for (auto& item : wtxItem.second.mapSaplingNoteData) {