From a0636e8f33a15f9b15fd42024a5340039cb3f1d0 Mon Sep 17 00:00:00 2001 From: ThomasV Date: Fri, 6 Jun 2025 08:46:21 +0200 Subject: [PATCH] lnworker: fix timestamp in get_lightning_history --- electrum/lnworker.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/electrum/lnworker.py b/electrum/lnworker.py index 5f402695d..4c78719b1 100644 --- a/electrum/lnworker.py +++ b/electrum/lnworker.py @@ -1100,6 +1100,7 @@ class LNWallet(LNWorker): direction=direction, ) out[payment_hash.hex()] = item + now = int(time.time()) for chan in itertools.chain(self.channels.values(), self.channel_backups.values()): # type: AbstractChannel item = chan.get_funding_height() if item is None: @@ -1112,7 +1113,7 @@ class LNWallet(LNWorker): type='channel_opening', label=label, group_id=funding_txid, - timestamp=funding_timestamp, + timestamp=funding_timestamp or now, amount_msat=chan.balance(LOCAL, ctn=0), fee_msat=None, payment_hash=None, @@ -1131,7 +1132,7 @@ class LNWallet(LNWorker): type='channel_closing', label=label, group_id=closing_txid, - timestamp=closing_timestamp, + timestamp=closing_timestamp or now, amount_msat=-chan.balance(LOCAL), fee_msat=None, payment_hash=None,