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

Function get_gossip

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

Source from the content-addressed store, hash-verified

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

Callers 1

test_gossip_not_dyingFunction · 0.85

Calls 1

runMethod · 0.45

Tested by

no test coverage detected