MCPcopy Create free account
hub / github.com/ElementsProject/lightning / get_gossip

Function get_gossip

tests/test_gossip.py:2094–2116  ·  view source on GitHub ↗
(node)

Source from the content-addressed store, hash-verified

2092 + len(l1.rpc.listchannels()['channels']) == 4)
2093
2094 def get_gossip(node):
2095 out = subprocess.run(['devtools/gossipwith',
2096 '--network={}'.format(TEST_NETWORK),
2097 '--all-gossip',
2098 '--timeout-after=2',
2099 '{}@localhost:{}'.format(node.info['id'], node.port)],
2100 check=True,
2101 timeout=TIMEOUT, stdout=subprocess.PIPE).stdout
2102
2103 msgs = []
2104 while len(out):
2105 l, t = struct.unpack('>HH', out[0:4])
2106 msg = out[2:2 + l]
2107 out = out[2 + l:]
2108
2109 # Ignore pings, gossip_timestamp_filter, query_channel_range
2110 if t in (18, 263, 265):
2111 continue
2112 # channel_announcement node_announcement or channel_update
2113 assert t == 256 or t == 257 or t == 258
2114 msgs.append(msg)
2115
2116 return msgs
2117
2118 assert len(get_gossip(l1)) == 5
2119

Callers 1

test_gossip_not_dyingFunction · 0.85

Calls 1

runMethod · 0.45

Tested by

no test coverage detected