Skip to content

Commit 7ec3281

Browse files
QT hanging fix
1 parent cc1641b commit 7ec3281

File tree

2 files changed

+9
-2
lines changed

2 files changed

+9
-2
lines changed

src/qt/masternodelist.cpp

+3-1
Original file line numberDiff line numberDiff line change
@@ -165,7 +165,9 @@ void MasternodeList::updateDIP3List()
165165
{
166166
// Get all UTXOs for each MN collateral in one go so that we can reduce locking overhead for cs_main
167167
// We also do this outside of the below Qt list update loop to reduce cs_main locking time to a minimum
168-
LOCK(cs_main);
168+
TRY_LOCK(cs_main,lock_main);
169+
if (!lock_main)
170+
return;
169171
mnList.ForEachMN(false, [&](const CDeterministicMNCPtr& dmn) {
170172
CTxDestination collateralDest;
171173
Coin coin;

src/qt/transactiondesc.cpp

+6-1
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,12 @@ QString TransactionDesc::toHTML(CWallet *wallet, CWalletTx &wtx, TransactionReco
7272
{
7373
QString strHTML;
7474

75-
LOCK2(cs_main, wallet->cs_wallet);
75+
TRY_LOCK(cs_main,lock_main);
76+
if (!lock_main)
77+
return strHTML;
78+
TRY_LOCK(wallet->cs_wallet,lock_wallet);
79+
if (!lock_wallet)
80+
return strHTML;
7681
strHTML.reserve(4000);
7782
strHTML += "<html><font face='verdana, arial, helvetica, sans-serif'>";
7883

0 commit comments

Comments
 (0)