mirror of
https://github.com/aljazceru/lightning.git
synced 2026-02-12 01:24:23 +01:00
common/wireaddr.h: simplify parse_wireaddr API.
1. Make it the standard "return the error" pattern. 2. Rather than flags to indicate what types are allowed, have the callers check the return explicitly. 3. Document the APIs. Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
This commit is contained in:
@@ -326,8 +326,8 @@ 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, chainparams_get_ln_port(chainparams), NULL,
|
||||
true, false, &err_msg))
|
||||
err_msg = parse_wireaddr_internal(tmpctx, at+1, chainparams_get_ln_port(chainparams), true, &addr);
|
||||
if (err_msg)
|
||||
opt_usage_exit_fail("%s '%s'", err_msg, argv[1]);
|
||||
|
||||
switch (addr.itype) {
|
||||
|
||||
Reference in New Issue
Block a user