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