mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-02-02 09:46:52 -05:00
GUI/Intro: Estimate max age of backups that can be restored with pruning
This commit is contained in:
parent
e2dcd957fa
commit
2a84c6bcf6
2 changed files with 12 additions and 0 deletions
|
@ -219,6 +219,13 @@
|
|||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QLabel" name="lblPruneSuffix">
|
||||
<property name="buddy">
|
||||
<cstring>pruneGB</cstring>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<spacer name="horizontalSpacer_2">
|
||||
<property name="orientation">
|
||||
|
|
|
@ -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) + " " +
|
||||
|
|
Loading…
Add table
Reference in a new issue