Skip to content

Commit a82bd8f

Browse files
committed
util: Replace magics with DEFAULT_PRUNE_TARGET_GB
This commit does not change behavior.
1 parent 5622d8f commit a82bd8f

File tree

3 files changed

+5
-2
lines changed

3 files changed

+5
-2
lines changed

src/qt/guiconstants.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,4 +51,7 @@ static const int TOOLTIP_WRAP_THRESHOLD = 80;
5151
/* One gigabyte (GB) in bytes */
5252
static constexpr uint64_t GB_BYTES{1000000000};
5353

54+
// Default prune target displayed in GUI.
55+
static constexpr int DEFAULT_PRUNE_TARGET_GB{2};
56+
5457
#endif // BITCOIN_QT_GUICONSTANTS_H

src/qt/intro.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -135,7 +135,7 @@ Intro::Intro(QWidget *parent, uint64_t blockchain_size, uint64_t chain_state_siz
135135
ui->prune->setChecked(true);
136136
ui->prune->setEnabled(false);
137137
}
138-
ui->prune->setText(tr("Discard blocks after verification, except most recent %1 GB (prune)").arg(pruneTarget ? pruneTarget / 1000 : 2));
138+
ui->prune->setText(tr("Discard blocks after verification, except most recent %1 GB (prune)").arg(pruneTarget ? pruneTarget / 1000 : DEFAULT_PRUNE_TARGET_GB));
139139
requiredSpace = m_blockchain_size;
140140
QString storageRequiresMsg = tr("At least %1 GB of data will be stored in this directory, and it will grow over time.");
141141
if (pruneTarget) {

src/qt/optionsmodel.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@ void OptionsModel::Init(bool resetSettings)
9191
if (!settings.contains("bPrune"))
9292
settings.setValue("bPrune", false);
9393
if (!settings.contains("nPruneSize"))
94-
settings.setValue("nPruneSize", 2);
94+
settings.setValue("nPruneSize", DEFAULT_PRUNE_TARGET_GB);
9595
SetPrune(settings.value("bPrune").toBool());
9696

9797
if (!settings.contains("nDatabaseCache"))

0 commit comments

Comments
 (0)