Skip to content

Commit 36f9d3a

Browse files
committed
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)
2 parents dd163f5 + a9baa6d commit 36f9d3a

File tree

1 file changed

+8
-3
lines changed

1 file changed

+8
-3
lines changed

src/qt/intro.cpp

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323

2424
static const uint64_t GB_BYTES = 1000000000LL;
2525
/* Minimum free space (in GB) needed for data directory */
26-
static const uint64_t BLOCK_CHAIN_SIZE = 80;
26+
static const uint64_t BLOCK_CHAIN_SIZE = 120;
2727
/* Minimum free space (in GB) needed for data directory when pruned; Does not include prune target */
2828
static const uint64_t CHAIN_STATE_SIZE = 2;
2929
/* Total required space (in GB) depending on user choice (prune, not prune) */
@@ -126,8 +126,13 @@ Intro::Intro(QWidget *parent) :
126126
ui->storageLabel->setText(ui->storageLabel->text().arg(tr(PACKAGE_NAME)));
127127
uint64_t pruneTarget = std::max<int64_t>(0, GetArg("-prune", 0));
128128
requiredSpace = BLOCK_CHAIN_SIZE;
129-
if (pruneTarget)
130-
requiredSpace = CHAIN_STATE_SIZE + std::ceil(pruneTarget * 1024 * 1024.0 / GB_BYTES);
129+
if (pruneTarget) {
130+
uint64_t prunedGBs = std::ceil(pruneTarget * 1024 * 1024.0 / GB_BYTES);
131+
if (prunedGBs <= requiredSpace) {
132+
requiredSpace = prunedGBs;
133+
}
134+
}
135+
requiredSpace += CHAIN_STATE_SIZE;
131136
ui->sizeWarningLabel->setText(ui->sizeWarningLabel->text().arg(tr(PACKAGE_NAME)).arg(requiredSpace));
132137
startThread();
133138
}

0 commit comments

Comments
 (0)