HomePhabricator

[Cashtab] Better handling of edge case utxo selection

Description

[Cashtab] Better handling of edge case utxo selection

Summary:
Depends on D18288

The current utxo selection approach in the sendXec function is incorrect. We can get into a situation where we need one more utxo, but we exit the loop without adding it and throw an 'insufficient funds' error.

Patch the logic to prevent this case.

Test Plan:
npm test

review the CI tests of D18290 to show that this exact test case throws an error on current prod

Reviewers: #bitcoin_abc, emack

Reviewed By: #bitcoin_abc, emack

Differential Revision: https://reviews.bitcoinabc.org/D18289

Details

Provenance
bytesofmanAuthored on Jun 24 2025, 23:04
bytesofmanPushed on Jun 25 2025, 03:28
Reviewer
Restricted Project
Differential Revision
D18289: [Cashtab] Better handling of edge case utxo selection
Parents
rABC805167c0f07d: [Cashtab] Code splitting only in prod
Branches
Unknown
Tags
Unknown