util: Avoid invalid integer negation in ValueFromAmount: make ValueFromAmount(const CAmount& n) well-defined also when n is std::numeric_limits<CAmount>::min()

This commit is contained in:
practicalswift
2020-11-16 16:44:50 +00:00
parent 7cc75c9ba3
commit 1f05dbd06d
5 changed files with 25 additions and 22 deletions

View File

@@ -40,7 +40,7 @@ std::vector<unsigned char> ParseHexUV(const UniValue& v, const std::string& strN
int ParseSighashString(const UniValue& sighash);
// core_write.cpp
UniValue ValueFromAmount(const CAmount& amount);
UniValue ValueFromAmount(const CAmount amount);
std::string FormatScript(const CScript& script);
std::string EncodeHexTx(const CTransaction& tx, const int serializeFlags = 0);
std::string SighashToStr(unsigned char sighash_type);