MCPcopy Create free account
hub / github.com/ElementsProject/lightning / param_route_exclusion

Function param_route_exclusion

common/json_param.c:1097–1122  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1095}
1096
1097struct 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
1124struct command_result *
1125param_route_exclusion_array(struct command *cmd, const char *name,

Callers 1

Calls 3

json_to_node_idFunction · 0.70
command_fail_badparamFunction · 0.70

Tested by

no test coverage detected