From 47efea92c6b5fe7693201b8fb815337d19aa311d Mon Sep 17 00:00:00 2001 From: Michael Schmoock Date: Wed, 8 Sep 2021 06:26:06 +0930 Subject: [PATCH] pyln-client/gossmap: let half channel have source and destination --- contrib/pyln-client/pyln/client/gossmap.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/contrib/pyln-client/pyln/client/gossmap.py b/contrib/pyln-client/pyln/client/gossmap.py index 71831797d..9e807c679 100755 --- a/contrib/pyln-client/pyln/client/gossmap.py +++ b/contrib/pyln-client/pyln/client/gossmap.py @@ -36,8 +36,12 @@ class GossmapHalfchannel(object): timestamp: int, cltv_expiry_delta: int, htlc_minimum_msat: int, htlc_maximum_msat: int, fee_base_msat: int, fee_proportional_millionths: int): + self.channel = channel self.direction = direction + self.source = channel.node1 if direction == 0 else channel.node2 + self.destination = channel.node2 if direction == 0 else channel.node1 + self.timestamp: int = timestamp self.cltv_expiry_delta: int = cltv_expiry_delta self.htlc_minimum_msat: int = htlc_minimum_msat @@ -115,7 +119,7 @@ class GossmapChannel(object): fields['fee_proportional_millionths']) self.half_channels[direction] = half - def get_half_channel(self, direction: int): + def get_direction(self, direction: int): """ returns the GossmapHalfchannel if known by channel_update """ if not 0 <= direction <= 1: raise ValueError("direction can only be 0 or 1")