diff options
author | fanquake <fanquake@gmail.com> | 2021-06-11 12:33:20 +0800 |
---|---|---|
committer | fanquake <fanquake@gmail.com> | 2021-08-04 19:48:24 +0800 |
commit | 5ef2738089efd396186775ad23aaec71ea44ebb1 (patch) | |
tree | 78b1d357ae955c7481f6dee1d15217a7271b2ecd /src/util/moneystr.h | |
parent | 3308c61091b6b7cb22569f3abadea6d001295c90 (diff) | |
download | bitcoin-5ef2738089efd396186775ad23aaec71ea44ebb1.tar.xz |
util: make ParseMoney return a std::optional<CAmount>
Diffstat (limited to 'src/util/moneystr.h')
-rw-r--r-- | src/util/moneystr.h | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/src/util/moneystr.h b/src/util/moneystr.h index 2aedbee358..b71dffd0db 100644 --- a/src/util/moneystr.h +++ b/src/util/moneystr.h @@ -12,6 +12,7 @@ #include <amount.h> #include <attributes.h> +#include <optional> #include <string> /* Do not use these functions to represent or parse monetary amounts to or from @@ -19,6 +20,6 @@ */ 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); +std::optional<CAmount> ParseMoney(const std::string& str); #endif // BITCOIN_UTIL_MONEYSTR_H |