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

Function param_route_exclusion

common/json_param.c:979–1004  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

977}
978
979struct command_result *param_route_exclusion(struct command *cmd,
980 const char *name, const char *buffer, const jsmntok_t *tok,
981 struct route_exclusion **re)
982{
983 *re = tal(cmd, struct route_exclusion);
984 struct short_channel_id_dir *chan_id =
985 tal(tmpctx, struct short_channel_id_dir);
986 if (!short_channel_id_dir_from_str(buffer + tok->start,
987 tok->end - tok->start,
988 chan_id)) {
989 struct node_id *node_id = tal(tmpctx, struct node_id);
990
991 if (!json_to_node_id(buffer, tok, node_id))
992 return command_fail_badparam(cmd, "exclude",
993 buffer, tok,
994 "should be short_channel_id_dir or node_id");
995
996 (*re)->type = EXCLUDE_NODE;
997 (*re)->u.node_id = *node_id;
998 } else {
999 (*re)->type = EXCLUDE_CHANNEL;
1000 (*re)->u.chan_id = *chan_id;
1001 }
1002
1003 return NULL;
1004}
1005
1006struct command_result *
1007param_route_exclusion_array(struct command *cmd, const char *name,

Callers 1

Calls 3

command_fail_badparamFunction · 0.85
json_to_node_idFunction · 0.70

Tested by

no test coverage detected