Skip to content

Commit 7b1d127

Browse files
devtools: revert changes and add sanity check
1 parent c84b416 commit 7b1d127

File tree

2 files changed

+4
-7
lines changed

2 files changed

+4
-7
lines changed

devtools/gossipwith.c

+2-7
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,6 @@
2121
#include <stdio.h>
2222
#include <wire/peer_wire.h>
2323

24-
#define chainparams_get_ln_port simple_get_ln_port
2524
#define io_write_ simple_write
2625
#define io_read_ simple_read
2726
#define io_close simple_close
@@ -46,11 +45,6 @@ static struct io_plan *simple_close(struct io_conn *conn)
4645
return NULL;
4746
}
4847

49-
static int simple_get_ln_port(const struct chainparams *params UNNEEDED)
50-
{
51-
return 9735;
52-
}
53-
5448
#include "../connectd/handshake.c"
5549

5650
/* This makes the handshake prototypes work. */
@@ -328,7 +322,8 @@ int main(int argc, char *argv[])
328322
opt_usage_exit_fail("Invalid id %.*s",
329323
(int)(at - argv[1]), argv[1]);
330324

331-
if (!parse_wireaddr_internal(at+1, &addr, simple_get_ln_port(NULL), NULL,
325+
assert(chainparams && "chainparams MUST be not NULL");
326+
if (!parse_wireaddr_internal(at+1, &addr, chainparams_get_ln_port(chainparams), NULL,
332327
true, false, true, &err_msg))
333328
opt_usage_exit_fail("%s '%s'", err_msg, argv[1]);
334329

tests/utils.py

+2
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
EXPERIMENTAL_FEATURES = env("EXPERIMENTAL_FEATURES", "0") == "1"
99
COMPAT = env("COMPAT", "1") == "1"
1010

11+
1112
def default_ln_port(network: str) -> int:
1213
network_map = {
1314
"bitcoin": 9735,
@@ -19,6 +20,7 @@ def default_ln_port(network: str) -> int:
1920
}
2021
return network_map[network]
2122

23+
2224
def anchor_expected():
2325
return EXPERIMENTAL_FEATURES or EXPERIMENTAL_DUAL_FUND
2426

0 commit comments

Comments
 (0)