In handlers.rs, create_tx's send_all branch uses only recipients[0] and silently drops the rest:
if send_all {
tx_builder.drain_wallet().drain_to(recipients[0].0.clone());
No check that exactly one recipient was given. Passing multiple --to with --send_all drains everything to the first one, no error - although send_all is meant for a single recipient (doc: "Requires only one recipient with value 0").
Notably the silent-payments create_tx in the same file already does the right check:
if send_all {
if sp_recipients.len() == 1 && maybe_recipients.is_none() {
tx_builder
.drain_wallet()
.drain_to(sp_recipients[0].get_placeholder_p2tr_spk());
}
So the regular create_tx is just inconsistent with the SP one.
Fix: in the regular create_tx send_all branch, error out unless exactly one recipient was provided (mirror the SP-create_tx check), instead of indexing recipients[0].
In handlers.rs,
create_tx'ssend_allbranch uses onlyrecipients[0]and silently drops the rest:No check that exactly one recipient was given. Passing multiple
--towith--send_alldrains everything to the first one, no error - althoughsend_allis meant for a single recipient (doc: "Requires only one recipient with value 0").Notably the silent-payments create_tx in the same file already does the right check:
So the regular create_tx is just inconsistent with the SP one.
Fix: in the regular create_tx send_all branch, error out unless exactly one recipient was provided (mirror the SP-create_tx check), instead of indexing recipients[0].