gossipd: call to return all connected peers.

And we report these through the getpeers JSON RPC again (carefully: in
our reconnect tests we can get duplicates which this patch now filters
out).

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
This commit is contained in:
Rusty Russell
2017-10-23 14:49:38 +10:30
parent a7d6326bef
commit 0c7ca9ab7c
5 changed files with 113 additions and 25 deletions

View File

@@ -279,9 +279,9 @@ class LightningDTests(BaseLightningDTests):
def test_connect(self):
l1,l2 = self.connect()
# Main daemon has no idea about these peers; they're in gossipd.
assert l1.rpc.getpeer(l2.info['id'], 'info') == None
assert l2.rpc.getpeer(l1.info['id'], 'info') == None
# These should be in gossipd.
assert l1.rpc.getpeer(l2.info['id'])['state'] == 'GOSSIPING'
assert l2.rpc.getpeer(l1.info['id'])['state'] == 'GOSSIPING'
# Both gossipds will have them as new peers once handed back.
l1.daemon.wait_for_log('handle_peer {}: new peer'.format(l2.info['id']))