From cace1b50136707fbc1a7b57d42fbe191ae3ea486 Mon Sep 17 00:00:00 2001 From: ThomasV Date: Fri, 29 Jul 2022 09:22:14 +0200 Subject: [PATCH] lnwatcher: compare txids instead of tx objects, before calling add_transaction or set_label --- electrum/lnwatcher.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/electrum/lnwatcher.py b/electrum/lnwatcher.py index 677df4064..c7c792b00 100644 --- a/electrum/lnwatcher.py +++ b/electrum/lnwatcher.py @@ -527,7 +527,7 @@ class LNWalletWatcher(LNWatcher): else: self.logger.info(f'cannot broadcast: {name} {reason}') # we may have a tx with a different fee, in which case it will be replaced - if old_tx != new_tx: + if old_tx and old_tx.txid() != new_tx.txid(): try: tx_was_added = self.adb.add_transaction(new_tx, notify_GUI=(old_tx is None)) except Exception as e: @@ -540,6 +540,6 @@ class LNWalletWatcher(LNWatcher): tx_was_added = False if tx_was_added: self.lnworker.wallet.set_label(new_tx.txid(), name) - if old_tx: + if old_tx and old_tx.txid() != new_tx.txid(): self.lnworker.wallet.set_label(old_tx.txid(), None) util.trigger_callback('wallet_updated', self.lnworker.wallet)