| 268 | AUTODATA(json_command, &sendonionmessage_command); |
| 269 | |
| 270 | static struct command_result *param_pubkeys(struct command *cmd, |
| 271 | const char *name, |
| 272 | const char *buffer, |
| 273 | const jsmntok_t *tok, |
| 274 | struct pubkey **pubkeys) |
| 275 | { |
| 276 | size_t i; |
| 277 | const jsmntok_t *t; |
| 278 | |
| 279 | if (tok->type != JSMN_ARRAY || tok->size == 0) |
| 280 | return command_fail(cmd, JSONRPC2_INVALID_PARAMS, |
| 281 | "%s must be an (non-empty) array", name); |
| 282 | |
| 283 | *pubkeys = tal_arr(cmd, struct pubkey, tok->size); |
| 284 | json_for_each_arr(i, t, tok) { |
| 285 | if (!json_to_pubkey(buffer, t, &(*pubkeys)[i])) |
| 286 | return command_fail_badparam(cmd, name, buffer, t, |
| 287 | "should be a compressed pubkey"); |
| 288 | } |
| 289 | return NULL; |
| 290 | } |
| 291 | |
| 292 | static struct command_result *json_blindedpath(struct command *cmd, |
| 293 | const char *buffer, |
nothing calls this directly
no test coverage detected