feat(wallet): change goes to an address the group can find (Phase 3)

Two open spends with change both paid to the first unused change
address, since a spend waiting for signatures has not used it yet.
Change indices are now reserved like coins: reservedChangeIndices reads
the claims of every open spend, and the builder takes the lowest watched,
unused, unheld index. It chooses among generated addresses only, so
change never lands outside the window; CHANGE_LOOKAHEAD rises to 10 and
past it a spend with change returns TooManyOpen.

The change branch not having answered is FindingChange rather than
NothingToSpend, and change too small to send back is reported as
Built.absorbed and said in the preview.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
Kgothatso NgakoandClaude Opus 5.5 committed 2026-10-23 12:22:32 +02:00
1 parent bc348419bc
commit 5c77853cfa
14 files changed
+327 -76

No files matched your search

@@ -657,6 +657,8 @@
<string name="sats_are_whole_numbers">Sats are whole numbers: there is nothing smaller than a sat to send.</string>
<string name="that_is_more_sats_than_there_will_ever_be">That is more sats than there will ever be.</string>
<string name="that_isn_t_an_amount_in_sats">That isn't an amount in sats.</string>
<string name="s_sats_left_over_go_to_the_fee">%1$s sats left over are too few to come back as change, and go to the fee.</string>
<string name="too_many_spends_are_open_with_change">The group has too many spends with change waiting for signatures. Wait for one to settle, or send everything.</string>
<string name="couldn_t_ask_the_group_to_send">Couldn't ask the group to send.</string>
<string name="sending_needs_a_share_and_a_node">Sending needs a share of the group's key, and a wallet of your own on this profile to see the group's coins with.</string>
<string name="nothing_leaves_until_a_quorum_signs">Nothing leaves the wallet until a quorum of members has seen this spend and signed it.</string>