Add dedicated error for when amounts aren't representable within a u64

Fixes the issue where _inputs_ could still overflow u64::MAX and cause a panic.
This commit is contained in:
Luke Parker
2025-08-09 14:06:27 -04:00
parent 54c9d19726
commit 8fcfa6d3d5
2 changed files with 42 additions and 17 deletions

View File

@@ -390,6 +390,8 @@ impl Monero {
MakeSignableTransactionResult::SignableTransaction(signable)
}
})),
// AmountsUnrepresentable is unreachable on Monero without 100% of the supply before tail
// emission or fundamental corruption
Err(e) => match e {
SendError::UnsupportedRctType => {
panic!("trying to use an RctType unsupported by monero-wallet")
@@ -398,6 +400,7 @@ impl Monero {
SendError::InvalidDecoyQuantity |
SendError::NoOutputs |
SendError::TooManyOutputs |
SendError::AmountsUnrepresentable { .. } |
SendError::NoChange |
SendError::TooMuchArbitraryData |
SendError::TooLargeTransaction |