util: check MoneyRange() inside ParseMoney()

This commit is contained in:
fanquake
2021-07-09 13:12:51 +08:00
parent 5ef2738089
commit f7752adba5
2 changed files with 5 additions and 1 deletions

View File

@@ -81,5 +81,9 @@ std::optional<CAmount> ParseMoney(const std::string& money_string)
CAmount value = nWhole * COIN + nUnits;
if (!MoneyRange(value)) {
return std::nullopt;
}
return value;
}