aboutsummaryrefslogtreecommitdiff
path: root/src/qt/optionsmodel.cpp
diff options
context:
space:
mode:
authorHennadii Stepanov <32963518+hebasto@users.noreply.github.com>2019-11-12 12:14:52 +0200
committerHennadii Stepanov <32963518+hebasto@users.noreply.github.com>2020-01-08 17:21:40 +0200
commit2bede28cd9ec638d8bb32c187ccf12d89345218e (patch)
tree9562a0b91bd66adae244f9d7222a1e7d5e995d40 /src/qt/optionsmodel.cpp
parente35e4b2ba052c9a533626286026dbe0a2d546c5b (diff)
downloadbitcoin-2bede28cd9ec638d8bb32c187ccf12d89345218e.tar.xz
util: Add PruneGBtoMiB() function
This commit does not change behavior.
Diffstat (limited to 'src/qt/optionsmodel.cpp')
-rw-r--r--src/qt/optionsmodel.cpp5
1 files changed, 2 insertions, 3 deletions
diff --git a/src/qt/optionsmodel.cpp b/src/qt/optionsmodel.cpp
index df5248f55e..f8cbd8358a 100644
--- a/src/qt/optionsmodel.cpp
+++ b/src/qt/optionsmodel.cpp
@@ -240,9 +240,8 @@ void OptionsModel::SetPruneEnabled(bool prune, bool force)
{
QSettings settings;
settings.setValue("bPrune", prune);
- // Convert prune size from GB to MiB:
- const uint64_t nPruneSizeMiB = (settings.value("nPruneSize").toInt() * GB_BYTES) >> 20;
- std::string prune_val = prune ? std::to_string(nPruneSizeMiB) : "0";
+ const int64_t prune_target_mib = PruneGBtoMiB(settings.value("nPruneSize").toInt());
+ std::string prune_val = prune ? std::to_string(prune_target_mib) : "0";
if (force) {
m_node.forceSetArg("-prune", prune_val);
return;