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

Function either

lightningd/pay.c:1396–1412  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1394-----------------------------------------------------------------------------*/
1395
1396static struct command_result *either(struct command *cmd,
1397 const char *name,
1398 const char *buffer,
1399 const jsmntok_t *tok,
1400 const char *name1,
1401 const char *name2,
1402 const jsmntok_t **ret)
1403{
1404 *ret = json_get_member(buffer, tok, name1);
1405 if (*ret)
1406 return NULL;
1407 *ret = json_get_member(buffer, tok, name2);
1408 if (*ret)
1409 return NULL;
1410 return command_fail_badparam(cmd, name, buffer, tok,
1411 tal_fmt(tmpctx, "must have either %s or %s", name1, name2));
1412}
1413
1414static struct command_result *param_route_hops(struct command *cmd,
1415 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