connect: return address we actually connected to.

Otherwise, we might find an address other than the one given and
the user might think that address worked.

Fixes: #4185
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
Changelog-Added: JSON-RPC: `connect` returns `address` it actually connected to
This commit is contained in:
Rusty Russell
2021-03-16 14:14:36 +10:30
parent 3fd22f86df
commit 6c9d9ee9a2
13 changed files with 42 additions and 21 deletions

View File

@@ -784,7 +784,8 @@ def test_address(node_factory):
l1.start()
l2 = node_factory.get_node()
l2.rpc.connect(l1.info['id'], l1.daemon.opts['bind-addr'])
ret = l2.rpc.connect(l1.info['id'], l1.daemon.opts['bind-addr'])
assert ret['address'] == {'type': 'local socket', 'socket': l1.daemon.opts['bind-addr']}
# 'addr' with local socket works too.
l1.stop()