From 2a84c6bcf61429ac507b506a39247b3a66edbcb4 Mon Sep 17 00:00:00 2001 From: Luke Dashjr Date: Tue, 21 Apr 2020 22:02:25 +0000 Subject: GUI/Intro: Estimate max age of backups that can be restored with pruning --- src/qt/intro.cpp | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'src/qt/intro.cpp') diff --git a/src/qt/intro.cpp b/src/qt/intro.cpp index e91722795c..f66eba1fef 100644 --- a/src/qt/intro.cpp +++ b/src/qt/intro.cpp @@ -148,6 +148,7 @@ Intro::Intro(QWidget *parent, int64_t blockchain_size_gb, int64_t chain_state_si } ui->pruneGB->setValue(m_prune_target_gb); ui->pruneGB->setToolTip(ui->prune->toolTip()); + ui->lblPruneSuffix->setToolTip(ui->prune->toolTip()); UpdatePruneLabels(ui->prune->isChecked()); connect(ui->prune, &QCheckBox::toggled, [this](bool prune_checked) { @@ -381,6 +382,10 @@ void Intro::UpdatePruneLabels(bool prune_checked) } ui->lblExplanation3->setVisible(prune_checked); ui->pruneGB->setEnabled(prune_checked); + static constexpr uint64_t nPowTargetSpacing = 10 * 60; // from chainparams, which we don't have at this stage + static constexpr uint32_t expected_block_data_size = 2250000; // includes undo data + const uint64_t expected_backup_days = m_prune_target_gb * 1e9 / (uint64_t(expected_block_data_size) * 86400 / nPowTargetSpacing); + ui->lblPruneSuffix->setText(tr("(sufficient to restore backups %n day(s) old)", "block chain pruning", expected_backup_days)); ui->sizeWarningLabel->setText( tr("%1 will download and store a copy of the Bitcoin block chain.").arg(PACKAGE_NAME) + " " + storageRequiresMsg.arg(m_required_space_gb) + " " + -- cgit v1.2.3