Take a lock on cs_main in DecrementNoteWitnesses

Another possibly better approach would be to take a lock inside
GetSaplingSpendDepth since we want the lock to apply to as little
code as possible and it is GetSaplingSpendDepth that calls GetDepthInMainChain
which requires a cs_main lock .
This commit is contained in:
Duke
2024-09-12 11:47:58 -04:00
parent aab240e3b3
commit 7f9878cf0c

View File

@@ -977,7 +977,7 @@ void CWallet::ClearNoteWitnessCache()
void CWallet::DecrementNoteWitnesses(const CBlockIndex* pindex)
{
LOCK(cs_wallet);
LOCK2(cs_main, cs_wallet);
extern int32_t HUSH_REWIND;