From 82f1756413441511d70c2ee824a3f3632b65bc4c Mon Sep 17 00:00:00 2001 From: The MMGen Project Date: Mon, 5 Oct 2026 14:30:05 +0000 Subject: [PATCH] tx.new: add label to autoselect prompt if present --- mmgen/tx/new.py | 8 +++++--- mmgen/tx/new_swap.py | 2 +- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/mmgen/tx/new.py b/mmgen/tx/new.py index e20d343d..206d0509 100755 --- a/mmgen/tx/new.py +++ b/mmgen/tx/new.py @@ -285,6 +285,7 @@ class New(Base): if self.chg_autoselected and not self.is_swap: # swap TX, so user has already confirmed self.confirm_autoselected_addr( self.chg_output.mmid, + self.chg_output.comment, 'change address') elif len(self.nondata_outputs) > 1: await self.warn_addr_used(self.proto, self.chg_output, 'change address') @@ -313,13 +314,14 @@ class New(Base): msg(f'{type(e).__name__}: {e}') return ad_f - def confirm_autoselected_addr(self, mmid, desc): + def confirm_autoselected_addr(self, mmid, lbl, desc): from ..ui import keypress_confirm keypress_confirm( self.cfg, - 'Using {a} as {b}. OK?'.format( + 'Using {a}{b}as {c}. OK?'.format( a = mmid.hl(), - b = 'single output address' if len(self.nondata_outputs) == 1 else desc), + b = ' {}\n '.format(lbl.hl2(encl='()')) if lbl else ' ', + c = 'single output address' if len(self.nondata_outputs) == 1 else desc), default_yes = True, do_exit = True) diff --git a/mmgen/tx/new_swap.py b/mmgen/tx/new_swap.py index 747ddd24..3e1be722 100755 --- a/mmgen/tx/new_swap.py +++ b/mmgen/tx/new_swap.py @@ -59,7 +59,7 @@ class NewSwap(New): exclude = [], desc = full_desc, match_all_addrtypes = not arg) - self.confirm_autoselected_addr(res.twmmid, full_desc) + self.confirm_autoselected_addr(res.twmmid, res.comment, full_desc) return ret(proto.coin, proto.network, res.addr, res.twmmid) async def get_chg_output(self, arg, addrfiles):