diff --git a/devtools/gossipwith.c b/devtools/gossipwith.c index 35f60b72689d..c85d36eb1070 100644 --- a/devtools/gossipwith.c +++ b/devtools/gossipwith.c @@ -21,7 +21,6 @@ #include #include -#define chainparams_get_ln_port simple_get_ln_port #define io_write_ simple_write #define io_read_ simple_read #define io_close simple_close @@ -46,11 +45,6 @@ static struct io_plan *simple_close(struct io_conn *conn) return NULL; } -static int simple_get_ln_port(const struct chainparams *params UNNEEDED) -{ - return 9735; -} - #include "../connectd/handshake.c" /* This makes the handshake prototypes work. */ @@ -183,13 +177,12 @@ static struct io_plan *handshake_success(struct io_conn *conn, OPTIONAL_FEATURE(OPT_INITIAL_ROUTING_SYNC)); if (!no_init) { - struct tlv_init_tlvs *tlvs = NULL; - if (chainparams) { - tlvs = tlv_init_tlvs_new(NULL); - tlvs->networks = tal_arr(tlvs, struct bitcoin_blkid, 1); - tlvs->networks[0] = chainparams->genesis_blockhash; - } - msg = towire_init(NULL, NULL, features, tlvs); + struct tlv_init_tlvs *tlvs; + + tlvs = tlv_init_tlvs_new(NULL); + tlvs->networks = tal_arr(tlvs, struct bitcoin_blkid, 1); + tlvs->networks[0] = chainparams->genesis_blockhash; + msg = towire_init(NULL, NULL, features, tlvs); sync_crypto_write(peer_fd, cs, take(msg)); /* Ignore their init message. */ @@ -287,6 +280,7 @@ int main(int argc, char *argv[]) memset(¬sosecret, 0x42, sizeof(notsosecret)); features = tal_arr(conn, u8, 0); + chainparams = chainparams_for_network("bitcoin"); opt_register_noarg("--initial-sync", opt_set_bool, &initial_sync, "Stream complete gossip history at start"); @@ -328,7 +322,7 @@ int main(int argc, char *argv[]) opt_usage_exit_fail("Invalid id %.*s", (int)(at - argv[1]), argv[1]); - if (!parse_wireaddr_internal(at+1, &addr, simple_get_ln_port(NULL), NULL, + if (!parse_wireaddr_internal(at+1, &addr, chainparams_get_ln_port(chainparams), NULL, true, false, true, &err_msg)) opt_usage_exit_fail("%s '%s'", err_msg, argv[1]); diff --git a/tests/utils.py b/tests/utils.py index 436e6fb3863c..0af3afadd6df 100644 --- a/tests/utils.py +++ b/tests/utils.py @@ -8,6 +8,7 @@ EXPERIMENTAL_FEATURES = env("EXPERIMENTAL_FEATURES", "0") == "1" COMPAT = env("COMPAT", "1") == "1" + def default_ln_port(network: str) -> int: network_map = { "bitcoin": 9735, @@ -15,10 +16,11 @@ def default_ln_port(network: str) -> int: "regtest": 19846, "signet": 39735, "liquid-regtest": 20735, - "liquid": 9735, + "liquid": 9735, } return network_map[network] + def anchor_expected(): return EXPERIMENTAL_FEATURES or EXPERIMENTAL_DUAL_FUND