1
0

lnworker: fix timestamp in get_lightning_history

This commit is contained in:
ThomasV
2025-06-06 08:46:21 +02:00
parent 7df8847aee
commit a0636e8f33

View File

@@ -1100,6 +1100,7 @@ class LNWallet(LNWorker):
direction=direction, direction=direction,
) )
out[payment_hash.hex()] = item out[payment_hash.hex()] = item
now = int(time.time())
for chan in itertools.chain(self.channels.values(), self.channel_backups.values()): # type: AbstractChannel for chan in itertools.chain(self.channels.values(), self.channel_backups.values()): # type: AbstractChannel
item = chan.get_funding_height() item = chan.get_funding_height()
if item is None: if item is None:
@@ -1112,7 +1113,7 @@ class LNWallet(LNWorker):
type='channel_opening', type='channel_opening',
label=label, label=label,
group_id=funding_txid, group_id=funding_txid,
timestamp=funding_timestamp, timestamp=funding_timestamp or now,
amount_msat=chan.balance(LOCAL, ctn=0), amount_msat=chan.balance(LOCAL, ctn=0),
fee_msat=None, fee_msat=None,
payment_hash=None, payment_hash=None,
@@ -1131,7 +1132,7 @@ class LNWallet(LNWorker):
type='channel_closing', type='channel_closing',
label=label, label=label,
group_id=closing_txid, group_id=closing_txid,
timestamp=closing_timestamp, timestamp=closing_timestamp or now,
amount_msat=-chan.balance(LOCAL), amount_msat=-chan.balance(LOCAL),
fee_msat=None, fee_msat=None,
payment_hash=None, payment_hash=None,