1
0

channel close handling: detect situation based on output addresses

WIP...
This commit is contained in:
SomberNight
2019-05-23 16:13:28 +02:00
committed by ThomasV
parent acbb458ef7
commit 930d21c31c
3 changed files with 95 additions and 9 deletions

View File

@@ -214,7 +214,13 @@ class LNWatcher(AddressSynchronizer):
self.network.trigger_callback('channel_open', funding_outpoint, funding_txid, funding_height)
else:
closing_height = self.get_tx_height(closing_txid)
self.network.trigger_callback('channel_closed', funding_outpoint, spenders, funding_txid, funding_height, closing_txid, closing_height)
closing_tx = self.db.get_transaction(closing_txid)
if not closing_tx:
self.logger.info(f"channel {funding_outpoint} closed by {closing_txid}. still waiting for tx itself...")
return
self.network.trigger_callback('channel_closed', funding_outpoint, spenders,
funding_txid, funding_height, closing_txid,
closing_height, closing_tx) # FIXME sooo many args..
await self.do_breach_remedy(funding_outpoint, spenders)
if not keep_watching:
self.unwatch_channel(address, funding_outpoint)