aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHennadii Stepanov <32963518+hebasto@users.noreply.github.com>2019-11-12 12:03:29 +0200
committerHennadii Stepanov <32963518+hebasto@users.noreply.github.com>2019-12-08 12:07:01 +0200
commita82bd8fa5708c16d1db3edc4e82d70788eb5af19 (patch)
treec5a625ff26c3418eaa2ea9f3010861efac1951ac
parent5622d8f3156a293e61d0964c33d4b21d8c9fd5e0 (diff)
util: Replace magics with DEFAULT_PRUNE_TARGET_GB
This commit does not change behavior.
-rw-r--r--src/qt/guiconstants.h3
-rw-r--r--src/qt/intro.cpp2
-rw-r--r--src/qt/optionsmodel.cpp2
3 files changed, 5 insertions, 2 deletions
diff --git a/src/qt/guiconstants.h b/src/qt/guiconstants.h
index dcdb247977..3bc242d0dc 100644
--- a/src/qt/guiconstants.h
+++ b/src/qt/guiconstants.h
@@ -51,4 +51,7 @@ static const int TOOLTIP_WRAP_THRESHOLD = 80;
/* One gigabyte (GB) in bytes */
static constexpr uint64_t GB_BYTES{1000000000};
+// Default prune target displayed in GUI.
+static constexpr int DEFAULT_PRUNE_TARGET_GB{2};
+
#endif // BITCOIN_QT_GUICONSTANTS_H
diff --git a/src/qt/intro.cpp b/src/qt/intro.cpp
index 53c80639b9..34b43c2636 100644
--- a/src/qt/intro.cpp
+++ b/src/qt/intro.cpp
@@ -135,7 +135,7 @@ Intro::Intro(QWidget *parent, uint64_t blockchain_size, uint64_t chain_state_siz
ui->prune->setChecked(true);
ui->prune->setEnabled(false);
}
- ui->prune->setText(tr("Discard blocks after verification, except most recent %1 GB (prune)").arg(pruneTarget ? pruneTarget / 1000 : 2));
+ ui->prune->setText(tr("Discard blocks after verification, except most recent %1 GB (prune)").arg(pruneTarget ? pruneTarget / 1000 : DEFAULT_PRUNE_TARGET_GB));
requiredSpace = m_blockchain_size;
QString storageRequiresMsg = tr("At least %1 GB of data will be stored in this directory, and it will grow over time.");
if (pruneTarget) {
diff --git a/src/qt/optionsmodel.cpp b/src/qt/optionsmodel.cpp
index d74d0dbfeb..c721c801e1 100644
--- a/src/qt/optionsmodel.cpp
+++ b/src/qt/optionsmodel.cpp
@@ -91,7 +91,7 @@ void OptionsModel::Init(bool resetSettings)
if (!settings.contains("bPrune"))
settings.setValue("bPrune", false);
if (!settings.contains("nPruneSize"))
- settings.setValue("nPruneSize", 2);
+ settings.setValue("nPruneSize", DEFAULT_PRUNE_TARGET_GB);
SetPrune(settings.value("bPrune").toBool());
if (!settings.contains("nDatabaseCache"))