From cb9634fd71d494e27648ca2bfc99013e0e0991f7 Mon Sep 17 00:00:00 2001 From: Vihiga Tyonum Date: Sat, 4 Jul 2026 11:13:21 +0100 Subject: [PATCH] ref(create_tx): enforce single recp for sendall --- src/handlers/offline.rs | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) 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 -- 2.49.0