lnwatcher: compare txids instead of tx objects, before calling add_transaction or set_label
This commit is contained in:
@@ -527,7 +527,7 @@ class LNWalletWatcher(LNWatcher):
|
|||||||
else:
|
else:
|
||||||
self.logger.info(f'cannot broadcast: {name} {reason}')
|
self.logger.info(f'cannot broadcast: {name} {reason}')
|
||||||
# we may have a tx with a different fee, in which case it will be replaced
|
# 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:
|
try:
|
||||||
tx_was_added = self.adb.add_transaction(new_tx, notify_GUI=(old_tx is None))
|
tx_was_added = self.adb.add_transaction(new_tx, notify_GUI=(old_tx is None))
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
@@ -540,6 +540,6 @@ class LNWalletWatcher(LNWatcher):
|
|||||||
tx_was_added = False
|
tx_was_added = False
|
||||||
if tx_was_added:
|
if tx_was_added:
|
||||||
self.lnworker.wallet.set_label(new_tx.txid(), name)
|
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)
|
self.lnworker.wallet.set_label(old_tx.txid(), None)
|
||||||
util.trigger_callback('wallet_updated', self.lnworker.wallet)
|
util.trigger_callback('wallet_updated', self.lnworker.wallet)
|
||||||
|
|||||||
Reference in New Issue
Block a user