From: Vihiga Tyonum Date: Sat, 4 Jul 2026 10:13:21 +0000 (+0100) Subject: ref(create_tx): enforce single recp for sendall X-Git-Url: http://internal-gitweb-vhost/blockdata/script/encode/-script/display/struct.DisplayArray.html?a=commitdiff_plain;h=cb9634fd71d494e27648ca2bfc99013e0e0991f7;p=bdk-cli ref(create_tx): enforce single recp for sendall --- diff --git a/src/handlers/offline.rs b/src/handlers/offline.rs index b441230..8a72091 100644 --- a/src/handlers/offline.rs +++ b/src/handlers/offline.rs @@ -242,9 +242,15 @@ impl AppCommand>> for CreateTxCommand { let mut tx_builder = ctx.state.wallet.build_tx(); if self.send_all { - tx_builder - .drain_wallet() - .drain_to(self.recipients[0].0.clone()); + if self.recipients.len() == 1 { + tx_builder + .drain_wallet() + .drain_to(self.recipients[0].0.clone()); + } else { + return Err(Error::Generic( + "Wallet can only be drained to a single output".to_string(), + )); + } } else { let recipients = self .recipients