From 1422e89eafa66467331d04c9009b7e6641605baf Mon Sep 17 00:00:00 2001 From: The MMGen Project Date: Mon, 5 Oct 2026 14:30:05 +0000 Subject: [PATCH] TwAddresses.get_change_address(): remove one indentation level --- mmgen/tw/addresses.py | 47 +++++++++++++++++++++++-------------------- 1 file changed, 25 insertions(+), 22 deletions(-) diff --git a/mmgen/tw/addresses.py b/mmgen/tw/addresses.py index 3cc1c1f1..2650c367 100755 --- a/mmgen/tw/addresses.py +++ b/mmgen/tw/addresses.py @@ -381,28 +381,31 @@ class TwAddresses(TwView): bot = 0 if bot is None else bot, top = len(self.data) - 1 if top is None else top) - if start is not None: - for d in self.data[start:]: - if d.al_id == key: - if ( - not d.is_used - and not d.twmmid in exclude - and ( - self.cfg.autochg_ignore_labels or - self.autochg_ignore_labels or - not d.comment) - ): - if d.comment and not self.autochg_ignore_labels: - msg('{} {} {} {}{}'.format( - yellow('WARNING: address'), - d.twmmid.hl(), - yellow('has a label,'), - d.comment.hl2(encl='‘’'), - yellow(f',\n but allowing it for {desc} anyway by user request'))) - return d - else: - break - return False + if start is None: + return None + + for d in self.data[start:]: + if d.al_id == key: + if ( + not d.is_used + and not d.twmmid in exclude + and ( + self.cfg.autochg_ignore_labels or + self.autochg_ignore_labels or + not d.comment) + ): + if d.comment and not self.autochg_ignore_labels: + msg('{} {} {} {}{}'.format( + yellow('WARNING: address'), + d.twmmid.hl(), + yellow('has a label,'), + d.comment.hl2(encl='‘’'), + yellow(f',\n but allowing it for {desc} anyway by user request'))) + return d + else: + break + + return False def get_change_address_by_addrtype(self, mmtype, *, exclude, desc): """