mirror of
https://github.com/aljazceru/lightning.git
synced 2025-12-19 07:04:22 +01:00
options: set DNS port to network default if not specified
- set port for a DNS announcement without port to network default - remove x-fail Changelog-Fixed: Port of a DNS announcement can be 0 if unspecified
This commit is contained in:
@@ -272,7 +272,10 @@ static char *opt_add_addr_withtype(const char *arg,
|
|||||||
wi.u.wireaddr.addrlen = strlen(address);
|
wi.u.wireaddr.addrlen = strlen(address);
|
||||||
strncpy((char * restrict)&wi.u.wireaddr.addr,
|
strncpy((char * restrict)&wi.u.wireaddr.addr,
|
||||||
address, sizeof(wi.u.wireaddr.addr) - 1);
|
address, sizeof(wi.u.wireaddr.addr) - 1);
|
||||||
wi.u.wireaddr.port = port;
|
if (port == 0)
|
||||||
|
wi.u.wireaddr.port = ld->portnum;
|
||||||
|
else
|
||||||
|
wi.u.wireaddr.port = port;
|
||||||
|
|
||||||
tal_arr_expand(&ld->proposed_listen_announce, ADDR_ANNOUNCE);
|
tal_arr_expand(&ld->proposed_listen_announce, ADDR_ANNOUNCE);
|
||||||
tal_arr_expand(&ld->proposed_wireaddr, wi);
|
tal_arr_expand(&ld->proposed_wireaddr, wi);
|
||||||
|
|||||||
@@ -247,7 +247,6 @@ def test_only_announce_one_dns(node_factory, bitcoind):
|
|||||||
|
|
||||||
|
|
||||||
@unittest.skipIf(not EXPERIMENTAL_FEATURES, "BOLT7 DNS RFC #911")
|
@unittest.skipIf(not EXPERIMENTAL_FEATURES, "BOLT7 DNS RFC #911")
|
||||||
@pytest.mark.xfail(strict=True, raises=AssertionError)
|
|
||||||
def test_announce_dns_without_port(node_factory, bitcoind):
|
def test_announce_dns_without_port(node_factory, bitcoind):
|
||||||
""" Checks that the port of a DNS announcement is set to the corresponding
|
""" Checks that the port of a DNS announcement is set to the corresponding
|
||||||
network port. In this case regtest 19846
|
network port. In this case regtest 19846
|
||||||
|
|||||||
Reference in New Issue
Block a user