mirror of
https://github.com/aljazceru/lightning.git
synced 2025-12-24 01:24:26 +01:00
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:
@@ -243,7 +243,14 @@ def test_connect_by_gossip(node_factory, bitcoind):
|
||||
l1.daemon.wait_for_logs(['Received node_announcement for node {}'.format(l3.info['id'])])
|
||||
|
||||
# Have l1 connect to l3 without explicit host and port.
|
||||
l1.rpc.connect(l3.info['id'])
|
||||
ret = l1.rpc.connect(l3.info['id'])
|
||||
assert ret['address'] == {'type': 'ipv4', 'address': '127.0.0.1', 'port': l3.port}
|
||||
|
||||
# Now give it *wrong* port (after we make sure l2 isn't listening), it should fall back.
|
||||
l1.rpc.disconnect(l3.info['id'])
|
||||
l2.stop()
|
||||
ret = l1.rpc.connect(l3.info['id'], 'localhost', l2.port)
|
||||
assert ret['address'] == {'type': 'ipv4', 'address': '127.0.0.1', 'port': l3.port}
|
||||
|
||||
|
||||
@unittest.skipIf(not DEVELOPER, "DEVELOPER=1 needed to speed up gossip propagation, would be too long otherwise")
|
||||
|
||||
Reference in New Issue
Block a user