util: Add PruneGBtoMiB() function

This commit does not change behavior.
This commit is contained in:
Hennadii Stepanov
2019-11-12 12:14:52 +02:00
parent e35e4b2ba0
commit 2bede28cd9
2 changed files with 7 additions and 3 deletions

View File

@@ -22,6 +22,11 @@ static constexpr unsigned short DEFAULT_GUI_PROXY_PORT = 9050;
*/
static inline int PruneMiBtoGB(int64_t mib) { return (mib * 1024 * 1024 + GB_BYTES - 1) / GB_BYTES; }
/**
* Convert displayed prune target GB to configured MiB. Round down so roundtrip GB -> MiB -> GB conversion is stable.
*/
static inline int64_t PruneGBtoMiB(int gb) { return gb * GB_BYTES / 1024 / 1024; }
/** Interface from Qt to configuration data structure for Bitcoin client.
To Qt, the options are presented as a list with the different options
laid out vertically.