| 1095 | } |
| 1096 | |
| 1097 | struct command_result *param_route_exclusion(struct command *cmd, |
| 1098 | const char *name, const char *buffer, const jsmntok_t *tok, |
| 1099 | struct route_exclusion **re) |
| 1100 | { |
| 1101 | *re = tal(cmd, struct route_exclusion); |
| 1102 | struct short_channel_id_dir *chan_id = |
| 1103 | tal(tmpctx, struct short_channel_id_dir); |
| 1104 | if (!short_channel_id_dir_from_str(buffer + tok->start, |
| 1105 | tok->end - tok->start, |
| 1106 | chan_id)) { |
| 1107 | struct node_id *node_id = tal(tmpctx, struct node_id); |
| 1108 | |
| 1109 | if (!json_to_node_id(buffer, tok, node_id)) |
| 1110 | return command_fail_badparam(cmd, "exclude", |
| 1111 | buffer, tok, |
| 1112 | "should be short_channel_id_dir or node_id"); |
| 1113 | |
| 1114 | (*re)->type = EXCLUDE_NODE; |
| 1115 | (*re)->u.node_id = *node_id; |
| 1116 | } else { |
| 1117 | (*re)->type = EXCLUDE_CHANNEL; |
| 1118 | (*re)->u.chan_id = *chan_id; |
| 1119 | } |
| 1120 | |
| 1121 | return NULL; |
| 1122 | } |
| 1123 | |
| 1124 | struct command_result * |
| 1125 | param_route_exclusion_array(struct command *cmd, const char *name, |
no test coverage detected