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

@@ -580,7 +580,14 @@ class Channel(AbstractChannel):
raise Exception('lnworker not set for channel!')
return self.lnworker.node_keypair.pubkey
def set_remote_update(self, raw: bytes) -> None:
def set_remote_update(self, payload: dict) -> None:
"""Save the ChannelUpdate message for the incoming direction of this channel.
This message contains info we need to populate private route hints when
creating invoices.
"""
from .channel_db import ChannelDB
ChannelDB.verify_channel_update(payload, start_node=self.node_id)
raw = payload['raw']
self.storage['remote_update'] = raw.hex()
def get_remote_update(self) -> Optional[bytes]: