diff --git a/src/qt/forms/overviewpage.ui b/src/qt/forms/overviewpage.ui index cfa01d25ce..2fe095a938 100644 --- a/src/qt/forms/overviewpage.ui +++ b/src/qt/forms/overviewpage.ui @@ -7,7 +7,7 @@ 0 0 960 - 541 + 585 @@ -326,7 +326,7 @@ - 24 + 0 diff --git a/src/qt/overviewpage.cpp b/src/qt/overviewpage.cpp index c3facbe5eb..590008168d 100644 --- a/src/qt/overviewpage.cpp +++ b/src/qt/overviewpage.cpp @@ -287,13 +287,22 @@ void OverviewPage::updateDarksendProgress() // calculate parts of the progress, each of them shouldn't be higher than 1: // mixing progress of denominated balance - float denomPart = (float)pwalletMain->GetNormalizedAnonymizedBalance() / pwalletMain->GetDenominatedBalance(); - denomPart = denomPart > 1 ? 1 : denomPart; + int64_t denominatedBalance = pwalletMain->GetDenominatedBalance(); + float denomPart = 0; + if(denominatedBalance > 0) + { + denomPart = (float)pwalletMain->GetNormalizedAnonymizedBalance() / pwalletMain->GetDenominatedBalance(); + denomPart = denomPart > 1 ? 1 : denomPart; + } // % of fully anonymized balance - float anonPart = (float)pwalletMain->GetAnonymizedBalance() / nMaxToAnonymize; - // if anonPart is > 1 then we are done, make denomPart equal 1 too - anonPart = anonPart > 1 ? (denomPart = 1, 1) : anonPart; + float anonPart = 0; + if(nMaxToAnonymize > 0) + { + anonPart = (float)pwalletMain->GetAnonymizedBalance() / nMaxToAnonymize; + // if anonPart is > 1 then we are done, make denomPart equal 1 too + anonPart = anonPart > 1 ? (denomPart = 1, 1) : anonPart; + } // apply some weights to them (sum should be <=100) and calculate the whole progress int progress = 80 * denomPart + 20 * anonPart;