From 59aa7611dd9dc05abee2836cda0454ef58410d27 Mon Sep 17 00:00:00 2001 From: ThomasV Date: Sat, 16 Sep 2023 11:09:39 +0200 Subject: [PATCH] add group_id to swap refund transactions, so that the GUI shows them as part of the swap tx group --- electrum/lnworker.py | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/electrum/lnworker.py b/electrum/lnworker.py index 2c150d5b4..97ebe9baa 100644 --- a/electrum/lnworker.py +++ b/electrum/lnworker.py @@ -1134,13 +1134,20 @@ class LNWallet(LNWorker): label += f' (refundable in {-delta} blocks)' # fixme: only if unspent self._labels_cache[txid] = label out[txid] = { - 'txid': txid, 'group_id': txid, - 'amount_msat': 0, - #'amount_msat': amount_msat, # must not be added + 'amount_msat': 0, # must be zero for onchain tx 'type': 'swap', - 'label': self.get_label_for_txid(txid), + 'label': _('Funding transaction'), } + if not swap.is_reverse: + # if the spending_tx is in the wallet, this will add it + # to the group (see wallet.get_full_history) + out[swap.spending_txid] = { + 'group_id': txid, + 'amount_msat': 0, # must be zero for onchain tx + 'type': 'swap', + 'label': _('Refund transaction'), + } return out def get_history(self):