util: ParseByteUnits - Parse a string with suffix unit [k|K|m|M|g|G|t|T]

A convenience utility for human readable arguments/config e.g. -maxuploadtarget=500g
This commit is contained in:
Douglas Chimento
2021-11-17 12:47:30 +02:00
parent 94db963de5
commit 21b58f430f
6 changed files with 138 additions and 4 deletions

View File

@@ -70,7 +70,7 @@ static const bool DEFAULT_LISTEN = true;
/** The maximum number of peer connections to maintain. */
static const unsigned int DEFAULT_MAX_PEER_CONNECTIONS = 125;
/** The default for -maxuploadtarget. 0 = Unlimited */
static constexpr uint64_t DEFAULT_MAX_UPLOAD_TARGET = 0;
static const std::string DEFAULT_MAX_UPLOAD_TARGET{"0M"};
/** Default for blocks only*/
static const bool DEFAULT_BLOCKSONLY = false;
/** -peertimeout default */