Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Do not calculate stuff that are not going to be visible in simple PS UI anyway #1656

Merged
merged 1 commit into from
Sep 27, 2017
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 13 additions & 13 deletions src/qt/overviewpage.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -350,19 +350,7 @@ void OverviewPage::updatePrivateSendProgress()
return;
}

CAmount nDenominatedConfirmedBalance;
CAmount nDenominatedUnconfirmedBalance;
CAmount nAnonymizableBalance;
CAmount nNormalizedAnonymizedBalance;
float nAverageAnonymizedRounds;

{
nDenominatedConfirmedBalance = pwalletMain->GetDenominatedBalance();
nDenominatedUnconfirmedBalance = pwalletMain->GetDenominatedBalance(true);
nAnonymizableBalance = pwalletMain->GetAnonymizableBalance(false, false);
nNormalizedAnonymizedBalance = pwalletMain->GetNormalizedAnonymizedBalance();
nAverageAnonymizedRounds = pwalletMain->GetAverageAnonymizedRounds();
}
CAmount nAnonymizableBalance = pwalletMain->GetAnonymizableBalance(false, false);

CAmount nMaxToAnonymize = nAnonymizableBalance + currentAnonymizedBalance;

Expand All @@ -389,6 +377,18 @@ void OverviewPage::updatePrivateSendProgress()
}
ui->labelAmountRounds->setText(strAmountAndRounds);

if (!fShowAdvancedPSUI) return;

CAmount nDenominatedConfirmedBalance;
CAmount nDenominatedUnconfirmedBalance;
CAmount nNormalizedAnonymizedBalance;
float nAverageAnonymizedRounds;

nDenominatedConfirmedBalance = pwalletMain->GetDenominatedBalance();
nDenominatedUnconfirmedBalance = pwalletMain->GetDenominatedBalance(true);
nNormalizedAnonymizedBalance = pwalletMain->GetNormalizedAnonymizedBalance();
nAverageAnonymizedRounds = pwalletMain->GetAverageAnonymizedRounds();

// calculate parts of the progress, each of them shouldn't be higher than 1
// progress of denominating
float denomPart = 0;
Expand Down