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

Function param_positive_msat_or_any

lightningd/invoice.c:1035–1052  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1033}
1034
1035static struct command_result *param_positive_msat_or_any(struct command *cmd,
1036 const char *name,
1037 const char *buffer,
1038 const jsmntok_t *tok,
1039 struct amount_msat **msat)
1040{
1041 if (json_tok_streq(buffer, tok, "any")) {
1042 *msat = NULL;
1043 return NULL;
1044 }
1045 *msat = tal(cmd, struct amount_msat);
1046 if (parse_amount_msat(*msat, buffer + tok->start, tok->end - tok->start)
1047 && !amount_msat_is_zero(**msat))
1048 return NULL;
1049
1050 return command_fail_badparam(cmd, name, buffer, tok,
1051 "should be positive msat or 'any'");
1052}
1053
1054static struct command_result *param_chanhints(struct command *cmd,
1055 const char *name,

Callers

nothing calls this directly

Calls 4

json_tok_streqFunction · 0.85
amount_msat_is_zeroFunction · 0.85
parse_amount_msatFunction · 0.50
command_fail_badparamFunction · 0.50

Tested by

no test coverage detected