From a244b508aa9759731407b462c57428984752bc0a Mon Sep 17 00:00:00 2001 From: ThomasV Date: Wed, 8 Mar 2023 17:52:15 +0100 Subject: [PATCH] Confirm tx dialog: warn if tx has multiple change outputs --- electrum/gui/qt/confirm_tx_dialog.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/electrum/gui/qt/confirm_tx_dialog.py b/electrum/gui/qt/confirm_tx_dialog.py index 80c2f8e98..5a9643ef2 100644 --- a/electrum/gui/qt/confirm_tx_dialog.py +++ b/electrum/gui/qt/confirm_tx_dialog.py @@ -569,6 +569,10 @@ class TxEditor(WindowModalDialog): # warn if we merge from mempool if self.tx.rbf_merge_txid: warnings.append(_('This payment was merged with another existing transaction.')) + # warn if we use multiple change outputs + num_change = sum(int(o.is_change) for o in self.tx.outputs()) + if num_change > 1: + warnings.append(_('This transaction has {} change outputs.'.format(num_change))) # TODO: warn if we send change back to input address self.warning = _('Warning') + ': ' + '\n'.join(warnings) if warnings else ''