| 1397 | -----------------------------------------------------------------------------*/ |
| 1398 | |
| 1399 | static struct command_result *either(struct command *cmd, |
| 1400 | const char *name, |
| 1401 | const char *buffer, |
| 1402 | const jsmntok_t *tok, |
| 1403 | const char *name1, |
| 1404 | const char *name2, |
| 1405 | const jsmntok_t **ret) |
| 1406 | { |
| 1407 | *ret = json_get_member(buffer, tok, name1); |
| 1408 | if (*ret) |
| 1409 | return NULL; |
| 1410 | *ret = json_get_member(buffer, tok, name2); |
| 1411 | if (*ret) |
| 1412 | return NULL; |
| 1413 | return command_fail_badparam(cmd, name, buffer, tok, |
| 1414 | tal_fmt(tmpctx, "must have either %s or %s", name1, name2)); |
| 1415 | } |
| 1416 | |
| 1417 | static struct command_result *param_route_hops(struct command *cmd, |
| 1418 | const char *name, |
no test coverage detected