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

Function param_newaddr

wallet/walletrpc.c:88–106  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

86}
87
88static struct command_result *param_newaddr(struct command *cmd,
89 const char *name,
90 const char *buffer,
91 const jsmntok_t *tok,
92 enum addrtype **addrtype)
93{
94 *addrtype = tal(cmd, enum addrtype);
95 if (json_tok_streq(buffer, tok, "bech32"))
96 **addrtype = ADDR_BECH32;
97 else if (!chainparams->is_elements && json_tok_streq(buffer, tok, "p2tr"))
98 **addrtype = ADDR_P2TR;
99 else if (json_tok_streq(buffer, tok, "all"))
100 **addrtype = ADDR_ALL;
101 else
102 return command_fail(cmd, JSONRPC2_INVALID_PARAMS,
103 "'%s' should be 'p2tr', 'bech32', or 'all', not '%.*s'",
104 name, tok->end - tok->start, buffer + tok->start);
105 return NULL;
106}
107
108bool WARN_UNUSED_RESULT newaddr_inner(struct command *cmd, struct pubkey *pubkey, enum addrtype addrtype)
109{

Callers

nothing calls this directly

Calls 2

json_tok_streqFunction · 0.85
command_failFunction · 0.50

Tested by

no test coverage detected