mirror of
https://github.com/aljazceru/lightning.git
synced 2025-12-24 01:24:26 +01:00
More flexible address wildcards, only add wildcard if nothing else.
1. Add special option where an empty host means 'wildcard for IPv4 and/or IPv6' which means ':1234' can be used to set only the portnum. 2. Only add this protocol wildcard if --autolisten=1 (default) and no other addresses specified. 3. Pass it down to gossipd, so it can handle errors correctly: in most cases, it's fatal not to be able to bind to a port, but for this case, it's OK if we can only bind to one of IPv4/v6 (fatal iff neither). Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
This commit is contained in:
committed by
Christian Decker
parent
73cd009a4c
commit
52917ff6c9
@@ -4281,6 +4281,13 @@ class LightningDTests(BaseLightningDTests):
|
||||
bitcoind.generate_block(1)
|
||||
l1.daemon.wait_for_log('ONCHAIN')
|
||||
|
||||
def test_address(self):
|
||||
l1 = self.node_factory.get_node()
|
||||
assert len(l1.rpc.getinfo()['address']) == 1
|
||||
assert l1.rpc.getinfo()['address'][0]['type'] == 'ipv4'
|
||||
assert l1.rpc.getinfo()['address'][0]['address'] == '127.0.0.1'
|
||||
assert int(l1.rpc.getinfo()['address'][0]['port']) == l1.port
|
||||
|
||||
def test_listconfigs(self):
|
||||
l1 = self.node_factory.get_node()
|
||||
|
||||
|
||||
Reference in New Issue
Block a user