| 283 | } |
| 284 | |
| 285 | static char *opt_add_announce_addr(const char *arg, struct lightningd *ld) |
| 286 | { |
| 287 | size_t n = tal_count(ld->proposed_wireaddr); |
| 288 | char *err; |
| 289 | |
| 290 | /* Check for autotor and reroute the call to --addr */ |
| 291 | if (strstarts(arg, "autotor:")) |
| 292 | return opt_add_addr(arg, ld); |
| 293 | |
| 294 | /* Check for statictor and reroute the call to --addr */ |
| 295 | if (strstarts(arg, "statictor:")) |
| 296 | return opt_add_addr(arg, ld); |
| 297 | |
| 298 | err = opt_add_addr_withtype(arg, ld, ADDR_ANNOUNCE, false); |
| 299 | if (err) |
| 300 | return err; |
| 301 | |
| 302 | /* Can't announce anything that's not a normal wireaddr. */ |
| 303 | if (ld->proposed_wireaddr[n].itype != ADDR_INTERNAL_WIREADDR) |
| 304 | return tal_fmt(NULL, "address '%s' is not announceable", |
| 305 | arg); |
| 306 | |
| 307 | return NULL; |
| 308 | } |
| 309 | |
| 310 | static char *opt_add_addr(const char *arg, struct lightningd *ld) |
| 311 | { |
no test coverage detected