MCPcopy Create free account
hub / github.com/ElementsProject/lightning / opt_add_announce_addr

Function opt_add_announce_addr

lightningd/options.c:285–308  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

283}
284
285static 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
310static char *opt_add_addr(const char *arg, struct lightningd *ld)
311{

Callers 1

opt_add_addrFunction · 0.85

Calls 2

opt_add_addrFunction · 0.85
opt_add_addr_withtypeFunction · 0.85

Tested by

no test coverage detected