mirror of
https://github.com/ElementsProject/lightning.git
synced 2024-11-19 01:43:36 +01:00
topology: don't show private nodes in listnodes.
This breaks our tests a bit, which assumed we can always see ourselves even if we don't have a proper channel. Usually we would deprecate this first, but it's unlikely to break anyone since it's a bit obscure that this worked at all. Signed-off-by: Rusty Russell <rusty@rustcorp.com.au> Changelog-Changed: JSON-RPC: `listnodes` no longer shows private (peer) nodes: use listpeers
This commit is contained in:
parent
f61ba7b332
commit
ea0d00e677
@ -1662,7 +1662,8 @@ class NodeFactory(object):
|
||||
# Make sure we have all node announcements, too
|
||||
for n in nodes:
|
||||
for n2 in nodes:
|
||||
wait_for(lambda: 'alias' in only_one(n.rpc.listnodes(n2.info['id'])['nodes']))
|
||||
alias = n2.rpc.getinfo()['alias']
|
||||
wait_for(lambda: [n.get('alias') for n in n.rpc.listnodes(n2.info['id'])['nodes']] == [alias])
|
||||
|
||||
def line_graph(self, num_nodes, fundchannel=True, fundamount=FUNDAMOUNT, wait_for_announce=False, opts=None, announce_channels=True):
|
||||
""" Create nodes, connect them and optionally fund channels.
|
||||
|
@ -515,7 +515,7 @@ static struct command_result *json_listnodes(struct command *cmd,
|
||||
NULL))
|
||||
return command_param_failed();
|
||||
|
||||
gossmap = get_gossmap(false);
|
||||
gossmap = get_gossmap(true);
|
||||
js = jsonrpc_stream_success(cmd);
|
||||
json_array_start(js, "nodes");
|
||||
if (id) {
|
||||
|
@ -136,8 +136,8 @@ def test_splice_listnodes(node_factory, bitcoind):
|
||||
|
||||
bitcoind.generate_block(7)
|
||||
|
||||
assert len(l1.rpc.listnodes()['nodes']) == 2
|
||||
assert len(l2.rpc.listnodes()['nodes']) == 2
|
||||
wait_for(lambda: len(l1.rpc.listnodes()['nodes']) == 2)
|
||||
wait_for(lambda: len(l2.rpc.listnodes()['nodes']) == 2)
|
||||
|
||||
|
||||
@pytest.mark.openchannel('v1')
|
||||
|
Loading…
Reference in New Issue
Block a user