aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorWladimir J. van der Laan <laanwj@gmail.com>2017-02-09 07:29:53 +0100
committerWladimir J. van der Laan <laanwj@gmail.com>2017-02-09 07:30:10 +0100
commit36f9d3ae6da48325b0a37ad7fd1abe263a0f2c9a (patch)
treebb1270a3f1d2dabe008496c5e702d164ed30e90f
parentdd163f57886991f3d564c9b0b1bf2ccc8f4ba784 (diff)
parenta9baa6d742c0425af4fb048cbd85707143227e84 (diff)
Merge #9718: Qt/Intro: Various fixes
a9baa6d Bugfix: Qt/Intro: Pruned nodes never require *more* space (Luke Dashjr) 93ffba7 Bugfix: Qt/Intro: Chain state needs to be stored even with the full blockchain (Luke Dashjr) c8cee26 Qt/Intro: Update block chain size (Luke Dashjr)
-rw-r--r--src/qt/intro.cpp11
1 files changed, 8 insertions, 3 deletions
diff --git a/src/qt/intro.cpp b/src/qt/intro.cpp
index e0678f45fc..6b5ac47f20 100644
--- a/src/qt/intro.cpp
+++ b/src/qt/intro.cpp
@@ -23,7 +23,7 @@
static const uint64_t GB_BYTES = 1000000000LL;
/* Minimum free space (in GB) needed for data directory */
-static const uint64_t BLOCK_CHAIN_SIZE = 80;
+static const uint64_t BLOCK_CHAIN_SIZE = 120;
/* Minimum free space (in GB) needed for data directory when pruned; Does not include prune target */
static const uint64_t CHAIN_STATE_SIZE = 2;
/* Total required space (in GB) depending on user choice (prune, not prune) */
@@ -126,8 +126,13 @@ Intro::Intro(QWidget *parent) :
ui->storageLabel->setText(ui->storageLabel->text().arg(tr(PACKAGE_NAME)));
uint64_t pruneTarget = std::max<int64_t>(0, GetArg("-prune", 0));
requiredSpace = BLOCK_CHAIN_SIZE;
- if (pruneTarget)
- requiredSpace = CHAIN_STATE_SIZE + std::ceil(pruneTarget * 1024 * 1024.0 / GB_BYTES);
+ if (pruneTarget) {
+ uint64_t prunedGBs = std::ceil(pruneTarget * 1024 * 1024.0 / GB_BYTES);
+ if (prunedGBs <= requiredSpace) {
+ requiredSpace = prunedGBs;
+ }
+ }
+ requiredSpace += CHAIN_STATE_SIZE;
ui->sizeWarningLabel->setText(ui->sizeWarningLabel->text().arg(tr(PACKAGE_NAME)).arg(requiredSpace));
startThread();
}