Skip to content

Commit

Permalink
QT hanging fix
Browse files Browse the repository at this point in the history
  • Loading branch information
levonpetrosyan93 committed Oct 18, 2024
1 parent cc1641b commit 7ec3281
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 deletions.
4 changes: 3 additions & 1 deletion src/qt/masternodelist.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,9 @@ void MasternodeList::updateDIP3List()
{
// Get all UTXOs for each MN collateral in one go so that we can reduce locking overhead for cs_main
// We also do this outside of the below Qt list update loop to reduce cs_main locking time to a minimum
LOCK(cs_main);
TRY_LOCK(cs_main,lock_main);
if (!lock_main)
return;
mnList.ForEachMN(false, [&](const CDeterministicMNCPtr& dmn) {
CTxDestination collateralDest;
Coin coin;
Expand Down
7 changes: 6 additions & 1 deletion src/qt/transactiondesc.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,12 @@ QString TransactionDesc::toHTML(CWallet *wallet, CWalletTx &wtx, TransactionReco
{
QString strHTML;

LOCK2(cs_main, wallet->cs_wallet);
TRY_LOCK(cs_main,lock_main);
if (!lock_main)
return strHTML;
TRY_LOCK(wallet->cs_wallet,lock_wallet);
if (!lock_wallet)
return strHTML;
strHTML.reserve(4000);
strHTML += "<html><font face='verdana, arial, helvetica, sans-serif'>";

Expand Down

0 comments on commit 7ec3281

Please sign in to comment.