DS progress weights depend on DS rounds in settings / force overview to update on OK in options
This commit is contained in:
parent
6fdefceb24
commit
745142f6bf
@ -251,7 +251,7 @@ void OptionsDialog::on_resetButton_clicked()
|
|||||||
void OptionsDialog::on_okButton_clicked()
|
void OptionsDialog::on_okButton_clicked()
|
||||||
{
|
{
|
||||||
mapper->submit();
|
mapper->submit();
|
||||||
darkSendPool.cachedNumBlocks = 0;
|
pwalletMain->MarkDirty();
|
||||||
accept();
|
accept();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -374,17 +374,25 @@ void OverviewPage::updateDarksendProgress()
|
|||||||
int64_t denominatedBalance = pwalletMain->GetDenominatedBalance() + nDenominatedUnconfirmedBalance;
|
int64_t denominatedBalance = pwalletMain->GetDenominatedBalance() + nDenominatedUnconfirmedBalance;
|
||||||
denomPart = (float)denominatedBalance / nMaxToAnonymize;
|
denomPart = (float)denominatedBalance / nMaxToAnonymize;
|
||||||
denomPart = denomPart > 1 ? 1 : denomPart;
|
denomPart = denomPart > 1 ? 1 : denomPart;
|
||||||
|
denomPart *= 100;
|
||||||
|
|
||||||
anonNormPart = (float)pwalletMain->GetNormalizedAnonymizedBalance() / nMaxToAnonymize;
|
anonNormPart = (float)pwalletMain->GetNormalizedAnonymizedBalance() / nMaxToAnonymize;
|
||||||
anonNormPart = anonNormPart > 1 ? 1 : anonNormPart;
|
anonNormPart = anonNormPart > 1 ? 1 : anonNormPart;
|
||||||
|
anonNormPart *= 100;
|
||||||
|
|
||||||
anonFullPart = (float)pwalletMain->GetAnonymizedBalance() / nMaxToAnonymize;
|
anonFullPart = (float)pwalletMain->GetAnonymizedBalance() / nMaxToAnonymize;
|
||||||
anonFullPart = anonFullPart > 1 ? 1 : anonFullPart;
|
anonFullPart = anonFullPart > 1 ? 1 : anonFullPart;
|
||||||
|
anonFullPart *= 100;
|
||||||
|
|
||||||
// apply some weights to them (sum should be <=100) and calculate the whole progress
|
// apply some weights to them ...
|
||||||
float denomPartCalc = ceilf((denomPart * 20) * 100) / 100;
|
float denomWeight = 1;
|
||||||
float anonNormPartCalc = ceilf((anonNormPart * 50) * 100) / 100;
|
float anonNormWeight = nDarksendRounds;
|
||||||
float anonFullPartCalc = ceilf((anonFullPart * 30) * 100) / 100;
|
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;
|
float progress = denomPartCalc + anonNormPartCalc + anonFullPartCalc;
|
||||||
if(progress >= 100) progress = 100;
|
if(progress >= 100) progress = 100;
|
||||||
|
|
||||||
@ -395,7 +403,7 @@ void OverviewPage::updateDarksendProgress()
|
|||||||
tr("Mixed") + ": %3%<br/>" +
|
tr("Mixed") + ": %3%<br/>" +
|
||||||
tr("Anonymized") + ": %4%<br/>" +
|
tr("Anonymized") + ": %4%<br/>" +
|
||||||
tr("Denominated inputs have %5 of %n rounds on average", "", nDarksendRounds))
|
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());
|
.arg(pwalletMain->GetAverageAnonymizedRounds());
|
||||||
ui->darksendProgress->setToolTip(strToolPip);
|
ui->darksendProgress->setToolTip(strToolPip);
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user