mirror of
https://github.com/ElementsProject/elements.git
synced 2026-08-17 13:07:54 +02:00
Merge #492: check amount against MAX_MONEY with unsigned comparison
36a40e8 check amount against MAX_MONEY with unsigned comparison (Dmitry Petukhov)
Pull request description:
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.
Tree-SHA512: c4c40a7126b66e7d1c18750a7151619ab76d48098139a800cbf2123dc5f52091c07508c75846415d05ac67d1d21da71bc30d726e120bf35480a48d85df3e7fe5
This commit is contained in:
commit
0da3b15df9
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