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

V0.12.0.x fixes for overview screen / DS progress #488

Merged
merged 1 commit into from
Aug 7, 2015
Merged
Show file tree
Hide file tree
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
2 changes: 1 addition & 1 deletion src/qt/optionsdialog.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -251,7 +251,7 @@ void OptionsDialog::on_resetButton_clicked()
void OptionsDialog::on_okButton_clicked()
{
mapper->submit();
darkSendPool.cachedNumBlocks = 0;
pwalletMain->MarkDirty();
accept();
}

Expand Down
20 changes: 14 additions & 6 deletions src/qt/overviewpage.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -374,17 +374,25 @@ void OverviewPage::updateDarksendProgress()
int64_t denominatedBalance = pwalletMain->GetDenominatedBalance() + nDenominatedUnconfirmedBalance;
denomPart = (float)denominatedBalance / nMaxToAnonymize;
denomPart = denomPart > 1 ? 1 : denomPart;
denomPart *= 100;

anonNormPart = (float)pwalletMain->GetNormalizedAnonymizedBalance() / nMaxToAnonymize;
anonNormPart = anonNormPart > 1 ? 1 : anonNormPart;
anonNormPart *= 100;

anonFullPart = (float)pwalletMain->GetAnonymizedBalance() / nMaxToAnonymize;
anonFullPart = anonFullPart > 1 ? 1 : anonFullPart;

// apply some weights to them (sum should be <=100) and calculate the whole progress
float denomPartCalc = ceilf((denomPart * 20) * 100) / 100;
float anonNormPartCalc = ceilf((anonNormPart * 50) * 100) / 100;
float anonFullPartCalc = ceilf((anonFullPart * 30) * 100) / 100;
anonFullPart *= 100;

// apply some weights to them ...
float denomWeight = 1;
float anonNormWeight = nDarksendRounds;
float anonFullWeight = 2;
float fullWeight = denomWeight + anonNormWeight + anonFullWeight;
// ... and calculate the whole progress
float denomPartCalc = ceilf((denomPart * denomWeight / fullWeight) * 100) / 100;
float anonNormPartCalc = ceilf((anonNormPart * anonNormWeight / fullWeight) * 100) / 100;
float anonFullPartCalc = ceilf((anonFullPart * anonFullWeight / fullWeight) * 100) / 100;
float progress = denomPartCalc + anonNormPartCalc + anonFullPartCalc;
if(progress >= 100) progress = 100;

Expand All @@ -395,7 +403,7 @@ void OverviewPage::updateDarksendProgress()
tr("Mixed") + ": %3%<br/>" +
tr("Anonymized") + ": %4%<br/>" +
tr("Denominated inputs have %5 of %n rounds on average", "", nDarksendRounds))
.arg(progress).arg(denomPart * 100).arg(anonNormPart * 100).arg(anonFullPart * 100)
.arg(progress).arg(denomPart).arg(anonNormPart).arg(anonFullPart)
.arg(pwalletMain->GetAverageAnonymizedRounds());
ui->darksendProgress->setToolTip(strToolPip);
}
Expand Down