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

Function either

lightningd/pay.c:1399–1415  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1397-----------------------------------------------------------------------------*/
1398
1399static 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
1417static struct command_result *param_route_hops(struct command *cmd,
1418 const char *name,

Callers 1

param_route_hopsFunction · 0.85

Calls 2

json_get_memberFunction · 0.85
command_fail_badparamFunction · 0.50

Tested by

no test coverage detected