Browse Source

lnwatcher: do not get_transaction before broadcast

this workaround was inserted to avoid losing the interface
when rebroadcasting a transaction already in the mempool
many times. but since the network should make sure we always
have a interface ready, and this problem shouldn't happen on
mainnet, remove the workaround
regtest_lnd
Janus 6 years ago
committed by SomberNight
parent
commit
946af47841
No known key found for this signature in database GPG Key ID: B33B5F232C6271E9
  1. 9
      electrum/lnwatcher.py

9
electrum/lnwatcher.py

@ -182,7 +182,7 @@ class LNWatcher(PrintError):
encumbered_sweep_txns = self.sweepstore[funding_outpoint][prev_txid]
if len(encumbered_sweep_txns) == 0:
if self.get_tx_mined_depth(prev_txid) == TxMinedDepth.DEEP:
self.print_error(e_tx.name, 'have no follow-up transactions and prevtx mined deep, returning')
self.print_error('have no follow-up transactions and prevtx', prev_txid, 'mined deep, returning')
return False
# check if any response applies
keep_watching_this = False
@ -225,13 +225,6 @@ class LNWatcher(PrintError):
height = self.addr_sync.get_tx_height(e_tx.tx.txid()).height
if height != TX_HEIGHT_LOCAL:
return
try:
await self.network.get_transaction(e_tx.tx.txid())
except:
pass
else:
self.print_error('already published, returning')
return
try:
txid = await self.network.broadcast_transaction(e_tx.tx)
except Exception as e:

Loading…
Cancel
Save