Commit 81a6f32
committed
Fix negative mintedValue passing through zero-check in fee loop
The guard at the top of the inner fee loop only checked
mintedValue == BigInt.zero, but mintedValue can go negative when
nFeeRet (starting from minFeeForGroup on retry) exceeds the UTXO
group's total value. A negative mintedValue would flow into
createSparkMintRecipients causing invalid outputs.
Change the check to <= BigInt.zero to match the intent of the
commented-out MoneyRange check from the C++ reference implementation.
https://claude.ai/code/session_01D9ssjMkQAMoCUcrPzVVtEq1 parent 3d0dec1 commit 81a6f32
1 file changed
Lines changed: 1 addition & 1 deletion
Lines changed: 1 addition & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1653 | 1653 | | |
1654 | 1654 | | |
1655 | 1655 | | |
1656 | | - | |
| 1656 | + | |
1657 | 1657 | | |
1658 | 1658 | | |
1659 | 1659 | | |
| |||
0 commit comments