mirror of
https://github.com/ElementsProject/elements.git
synced 2026-08-17 13:07:54 +02:00
check amount against MAX_MONEY with unsigned comparison
Because explicit conversion of arbitrarily large unsigned values to signed values of the same bit width is implementation defined until c++20, better check against MAX_MONEY with unsigned comparison.
This commit is contained in:
parent
43f6cdbd31
commit
36a40e853f
1 changed files with 1 additions and 1 deletions
|
|
@ -95,7 +95,7 @@ bool UnblindConfidentialPair(const CKey &key, const CConfidentialValue& confValu
|
|||
}
|
||||
|
||||
// Value sidechannel must be a transaction-valid amount (should be belt-and-suspenders check)
|
||||
if (!MoneyRange((CAmount)amount)) {
|
||||
if (amount > (uint64_t)MAX_MONEY || !MoneyRange((CAmount)amount)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue