Skip to content

Commit

Permalink
pyln/client/gossmap: add a little documentation.
Browse files Browse the repository at this point in the history
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
  • Loading branch information
rustyrussell authored and cdecker committed Jun 21, 2021
1 parent a68aeb2 commit 15a4bf1
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions contrib/pyln-client/pyln/client/gossmap.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ class point(bytes):


class GossmapChannel(object):
"""A channel: fields of channel_announcement are in .fields, optional updates are in .updates_fields, which can be None of there has been no channel update."""
def __init__(self,
fields: Dict[str, Any],
announce_offset: int,
Expand All @@ -56,6 +57,10 @@ def __init__(self,


class GossmapNode(object):
"""A node: fields of node_announcement are in .announce_fields, which can be None of there has been no node announcement.
.channels is a list of the GossmapChannels attached to this node.
"""
def __init__(self, node_id: point):
self.announce_fields: Optional[Dict[str, Any]] = None
self.announce_offset = None
Expand Down Expand Up @@ -127,6 +132,7 @@ def add_node_announcement(self, rec: bytes, off: int):
self.nodes[fields['node_id']].announce_offset = off

def reopen_store(self):
"""FIXME: Implement!"""
assert False

def remove_channel_by_deletemsg(self, rec: bytes):
Expand Down

0 comments on commit 15a4bf1

Please sign in to comment.