You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
pyln-client/gossmap: Don't mix bytes and GossmapNodeId
Do not mix bytes and GossmapNodeId when accessing Gossmap.nodes dicts.
Therefore the definion got GossmapNodeId also needed to be pulled to the
beginning of the file.
raiseValueError(f"{s} is not a valid hexstring of a node_id")
79
+
returnGossmapNodeId(bytes.fromhex(s))
80
+
81
+
53
82
classGossmapChannel(object):
54
83
"""A channel: fields of channel_announcement are in .fields, optional updates are in .updates_fields, which can be None if there has been no channel update."""
55
84
def__init__(self,
56
85
fields: Dict[str, Any],
57
86
announce_offset: int,
58
87
scid,
59
-
node1_id: bytes,
60
-
node2_id: bytes,
88
+
node1_id: GossmapNodeId,
89
+
node2_id: GossmapNodeId,
61
90
is_private: bool):
62
91
self.fields=fields
63
92
self.announce_offset=announce_offset
@@ -96,35 +125,6 @@ def __repr__(self):
96
125
return"GossmapChannel[{}]".format(str(self.scid))
97
126
98
127
99
-
classGossmapNodeId(object):
100
-
def__init__(self, buf: bytes):
101
-
iflen(buf) !=33or (buf[0] !=2andbuf[0] !=3):
102
-
raiseValueError("{} is not a valid node_id".format(buf.hex()))
0 commit comments