| 454 | } |
| 455 | |
| 456 | static struct command_result *param_pubkey_arr(struct command *cmd, |
| 457 | const char *name, |
| 458 | const char *buffer, |
| 459 | const jsmntok_t *tok, |
| 460 | const struct pubkey **keys) |
| 461 | { |
| 462 | size_t i; |
| 463 | const jsmntok_t *t; |
| 464 | struct pubkey *arr; |
| 465 | |
| 466 | if (tok->type != JSMN_ARRAY) |
| 467 | return command_fail_badparam(cmd, name, buffer, tok, |
| 468 | "should be an array of nodes"); |
| 469 | |
| 470 | arr = tal_arr(cmd, struct pubkey, tok->size); |
| 471 | json_for_each_arr(i, t, tok) { |
| 472 | if (!json_to_pubkey(buffer, t, &arr[i])) |
| 473 | return command_fail_badparam(cmd, name, buffer, t, |
| 474 | "invalid pubkey"); |
| 475 | } |
| 476 | *keys = arr; |
| 477 | return NULL; |
| 478 | } |
| 479 | |
| 480 | struct command_result *json_offer(struct command *cmd, |
| 481 | const char *buffer, |
nothing calls this directly
no test coverage detected