Skip to content

Commit 7d40a48

Browse files
committed
GUI/Intro: Estimate max age of backups that can be restored with pruning
1 parent 77f3f2d commit 7d40a48

File tree

2 files changed

+11
-0
lines changed

2 files changed

+11
-0
lines changed

src/qt/forms/intro.ui

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -219,6 +219,13 @@
219219
</property>
220220
</widget>
221221
</item>
222+
<item>
223+
<widget class="QLabel" name="lblPruneSuffix">
224+
<property name="buddy">
225+
<cstring>pruneGB</cstring>
226+
</property>
227+
</widget>
228+
</item>
222229
<item>
223230
<spacer name="horizontalSpacer_2">
224231
<property name="orientation">

src/qt/intro.cpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -148,6 +148,7 @@ Intro::Intro(QWidget *parent, int64_t blockchain_size_gb, int64_t chain_state_si
148148
}
149149
ui->pruneGB->setValue(m_prune_target_gb);
150150
ui->pruneGB->setToolTip(ui->prune->toolTip());
151+
ui->lblPruneSuffix->setToolTip(ui->prune->toolTip());
151152
UpdatePruneLabels(ui->prune->isChecked());
152153

153154
connect(ui->prune, &QCheckBox::toggled, [this](bool prune_checked) {
@@ -381,6 +382,9 @@ void Intro::UpdatePruneLabels(bool prune_checked)
381382
}
382383
ui->lblExplanation3->setVisible(prune_checked);
383384
ui->pruneGB->setEnabled(prune_checked);
385+
static const uint64_t nPowTargetSpacing = 10 * 60; // from chainparams, which we don't have at this stage
386+
static const uint32_t expected_block_data_size = 2250000; // includes undo data
387+
ui->lblPruneSuffix->setText(tr("(sufficient to restore backups %n day(s) old)", "block chain pruning", m_prune_target_gb * 1e9 / (uint64_t(expected_block_data_size) * 86400 / nPowTargetSpacing)));
384388
ui->sizeWarningLabel->setText(
385389
tr("%1 will download and store a copy of the Bitcoin block chain.").arg(PACKAGE_NAME) + " " +
386390
storageRequiresMsg.arg(m_required_space_gb) + " " +

0 commit comments

Comments
 (0)