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

Function param_id_addr_u16

lightningd/connect_control.c:140–162  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

138}
139
140static struct command_result *param_id_addr_u16(struct command *cmd,
141 const char *name,
142 const char *buffer,
143 const jsmntok_t *tok,
144 const u16 **port)
145{
146 u16 val;
147 if (*port) {
148 return command_fail(cmd, JSONRPC2_INVALID_PARAMS,
149 "Can't specify port as both xxx@yyy:port "
150 "and separate argument");
151 }
152 if (json_to_u16(buffer, tok, &val)) {
153 if (val == 0)
154 return command_fail_badparam(cmd, name, buffer, tok,
155 "should be non-zero");
156 *port = tal_dup(cmd, u16, &val);
157 return NULL;
158 }
159
160 return command_fail_badparam(cmd, name, buffer, tok,
161 "should be a 16-bit integer");
162}
163
164static struct command_result *json_connect(struct command *cmd,
165 const char *buffer,

Callers

nothing calls this directly

Calls 3

command_failFunction · 0.70
json_to_u16Function · 0.50
command_fail_badparamFunction · 0.50

Tested by

no test coverage detected