mirror of
https://github.com/dashpay/dash.git
synced 2024-12-25 12:02:48 +01:00
Fix potential deadlock in LoadWallet() (#2806)
* Fix potential deadlock in LoadWallet() ``` POTENTIAL DEADLOCK DETECTED Previous lock order was: (1) cs_main wallet/wallet.cpp:3881 (2) cs_wallet wallet/wallet.cpp:3881 Current lock order is: (2) pwallet->cs_wallet wallet/walletdb.cpp:589 (1) cs_main wallet/wallet.cpp:1252 ``` * Add comment in CWallet::MarkConflicted re new cs_main lock in CWalletDB::LoadWallet()
This commit is contained in:
parent
81eeff1c54
commit
162acc5a0d
@ -1249,7 +1249,7 @@ bool CWallet::AbandonTransaction(const uint256& hashTx)
|
||||
|
||||
void CWallet::MarkConflicted(const uint256& hashBlock, const uint256& hashTx)
|
||||
{
|
||||
LOCK2(cs_main, cs_wallet);
|
||||
LOCK2(cs_main, cs_wallet); // check "LOCK2(cs_main, pwallet->cs_wallet);" in CWalletDB::LoadWallet()
|
||||
|
||||
int conflictconfirms = 0;
|
||||
if (mapBlockIndex.count(hashBlock)) {
|
||||
|
@ -586,7 +586,7 @@ DBErrors CWalletDB::LoadWallet(CWallet* pwallet)
|
||||
bool fNoncriticalErrors = false;
|
||||
DBErrors result = DB_LOAD_OK;
|
||||
|
||||
LOCK(pwallet->cs_wallet);
|
||||
LOCK2(cs_main, pwallet->cs_wallet);
|
||||
try {
|
||||
int nMinVersion = 0;
|
||||
if (Read((std::string)"minversion", nMinVersion))
|
||||
|
Loading…
Reference in New Issue
Block a user