Conversation
| } | ||
| } | ||
|
|
||
| if (selectedAda >= requiredAda) break |
There was a problem hiding this comment.
Bug: UTXO token tracking occurs before selection decision
In the UTXO selection loop, currentTokensInChange and requiredAda are updated based on the current UTXO's tokens before checking whether to select the UTXO. This means if the loop breaks at line 418 after updating these values, the tokens were counted as going to change even though the UTXO was never added to selected. Additionally, by increasing requiredAda before deciding to include the UTXO, the algorithm may select more UTXOs than necessary, since each UTXO with tokens increases the requirement before its ADA contribution is added to selectedAda. The token tracking and requiredAda recalculation (lines 394-416) should happen after adding the UTXO to selected (lines 419-420), not before checking the break condition.
Note
Improve UTXO selection by accounting for token change min-UTXO and preferring pure ADA UTXOs; add gradient styling to airdrop cards; remove wallet-list feature flags to always show syncing/check states.
mobile/packages/tx/transaction-builder/helpers.ts)selectUtxosForAmountsto:AirdropDetailsScreen: UseLinearGradientbackground for the “Redeemable Now” card and adjust borders/overflow styling.AirdropSelectionScreen: Add gradient background on press/redeemable cards; minor layout/style tweaks.WalletListItem: Always show syncingLoadingand selected check; remove feature-flag gating.mobile/src/kernel/features.ts)Written by Cursor Bugbot for commit 2503b9a. This will update automatically on new commits. Configure here.