diff options
Diffstat (limited to 'src/util')
-rw-r--r-- | src/util/moneystr.cpp | 10 | ||||
-rw-r--r-- | src/util/moneystr.h | 2 |
2 files changed, 6 insertions, 6 deletions
diff --git a/src/util/moneystr.cpp b/src/util/moneystr.cpp index 2797f450ca..40d8918dfc 100644 --- a/src/util/moneystr.cpp +++ b/src/util/moneystr.cpp @@ -36,14 +36,14 @@ bool ParseMoney(const std::string& str, CAmount& nRet) if (!ValidAsCString(str)) { return false; } - return ParseMoney(str.c_str(), nRet); -} -bool ParseMoney(const char* pszIn, CAmount& nRet) -{ + if (str.empty()) { + return false; + } + std::string strWhole; int64_t nUnits = 0; - const char* p = pszIn; + const char* p = str.c_str(); while (IsSpace(*p)) p++; for (; *p; p++) diff --git a/src/util/moneystr.h b/src/util/moneystr.h index 027c7e2e53..d8b08adc24 100644 --- a/src/util/moneystr.h +++ b/src/util/moneystr.h @@ -18,7 +18,7 @@ * JSON but use AmountFromValue and ValueFromAmount for that. */ std::string FormatMoney(const CAmount& n); +/** Parse an amount denoted in full coins. E.g. "0.0034" supplied on the command line. **/ NODISCARD bool ParseMoney(const std::string& str, CAmount& nRet); -NODISCARD bool ParseMoney(const char* pszIn, CAmount& nRet); #endif // BITCOIN_UTIL_MONEYSTR_H |