mirror of
https://github.com/aljazceru/lightning.git
synced 2025-12-19 15:14:23 +01:00
options: fix ld proposed_wireaddr proposed_listen_announce get out of sync
Incase the error handling happening after the quted line is non-critical:
```
return tal_fmt(NULL, "Unable to parse address '%s': %s", arg, err_msg);
```
we should not expand the proposed_listen_announce array without adding
a proposed_wireaddr. So we move the expand of proposed_listen_announce
to the location where we also expand the proposed_wireaddr.
Changelog-None
This commit is contained in:
committed by
Rusty Russell
parent
35c6f90666
commit
45f6bf6cf1
@@ -191,7 +191,6 @@ static char *opt_add_addr_withtype(const char *arg,
|
|||||||
|
|
||||||
assert(arg != NULL);
|
assert(arg != NULL);
|
||||||
|
|
||||||
tal_arr_expand(&ld->proposed_listen_announce, ala);
|
|
||||||
if (!parse_wireaddr_internal(arg, &wi,
|
if (!parse_wireaddr_internal(arg, &wi,
|
||||||
ld->portnum,
|
ld->portnum,
|
||||||
wildcard_ok, !ld->always_use_proxy, false,
|
wildcard_ok, !ld->always_use_proxy, false,
|
||||||
@@ -210,6 +209,8 @@ static char *opt_add_addr_withtype(const char *arg,
|
|||||||
ala & ADDR_ANNOUNCE ? "announce" : "listen",
|
ala & ADDR_ANNOUNCE ? "announce" : "listen",
|
||||||
type_to_string(tmpctx, struct wireaddr_internal, &wi));
|
type_to_string(tmpctx, struct wireaddr_internal, &wi));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
tal_arr_expand(&ld->proposed_listen_announce, ala);
|
||||||
tal_arr_expand(&ld->proposed_wireaddr, wi);
|
tal_arr_expand(&ld->proposed_wireaddr, wi);
|
||||||
return NULL;
|
return NULL;
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user