1
0

lnchannel: verify sig of remote chanupd (for inc edge of direct chan)

This is re the channel update for the incoming direction of our own channels.
This message can only come from the counterparty itself so maybe the sig check
is redundant... but for sanity I think we should check it anyway.
This commit is contained in:
SomberNight
2021-03-16 19:07:31 +01:00
parent bcfcc20363
commit 468f3b2b8d
4 changed files with 18 additions and 8 deletions

View File

@@ -1284,10 +1284,11 @@ class LNWallet(LNWorker):
short_channel_id = ShortChannelID(payload['short_channel_id'])
if r == UpdateStatus.GOOD:
self.logger.info(f"applied channel update to {short_channel_id}")
# TODO: test this
# TODO: add test for this
# FIXME: this does not work for our own unannounced channels.
for chan in self.channels.values():
if chan.short_channel_id == short_channel_id:
chan.set_remote_update(payload['raw'])
chan.set_remote_update(payload)
update = True
elif r == UpdateStatus.ORPHANED:
# maybe it is a private channel (and data in invoice was outdated)