mirror of
https://github.com/LBRYFoundation/LBRY-Vault.git
synced 2025-08-23 17:47:31 +00:00
lnworker: save timestamp regardless of channel state
This commit is contained in:
parent
3a2fe80675
commit
11f1541cdd
1 changed files with 4 additions and 1 deletions
|
@ -661,6 +661,10 @@ class LNWallet(LNWorker):
|
|||
chan = self.channel_by_txo(funding_outpoint)
|
||||
if not chan:
|
||||
return
|
||||
|
||||
# save timestamp regardless of state, so that funding tx is returned in get_history
|
||||
self.channel_timestamps[bh2u(chan.channel_id)] = chan.funding_outpoint.txid, funding_height.height, funding_height.timestamp, None, None, None
|
||||
|
||||
if chan.get_state() == channel_states.OPEN and self.should_channel_be_closed_due_to_expiring_htlcs(chan):
|
||||
self.logger.info(f"force-closing due to expiring htlcs")
|
||||
await self.force_close_channel(chan.channel_id)
|
||||
|
@ -671,7 +675,6 @@ class LNWallet(LNWorker):
|
|||
self.save_short_chan_id(chan)
|
||||
if chan.short_channel_id:
|
||||
chan.set_state(channel_states.FUNDED)
|
||||
self.channel_timestamps[bh2u(chan.channel_id)] = chan.funding_outpoint.txid, funding_height.height, funding_height.timestamp, None, None, None
|
||||
self.storage.put('lightning_channel_timestamps', self.channel_timestamps)
|
||||
|
||||
if chan.get_state() == channel_states.FUNDED:
|
||||
|
|
Loading…
Add table
Reference in a new issue