diff options
author | Luke Dashjr <luke-jr+git@utopios.org> | 2020-04-21 22:02:25 +0000 |
---|---|---|
committer | Luke Dashjr <luke-jr+git@utopios.org> | 2020-11-30 02:46:43 +0000 |
commit | 2a84c6bcf61429ac507b506a39247b3a66edbcb4 (patch) | |
tree | bf219200f3c713e917be0030af9d2a37ac73d78c /src/qt/intro.cpp | |
parent | e2dcd957fa206a28404ff824fb764b8889705fb2 (diff) |
GUI/Intro: Estimate max age of backups that can be restored with pruning
Diffstat (limited to 'src/qt/intro.cpp')
-rw-r--r-- | src/qt/intro.cpp | 5 |
1 files changed, 5 insertions, 0 deletions
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) + " " + |