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

Function param_policy_mod

plugins/funder.c:838–861  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

836
837
838static struct command_result *
839param_policy_mod(struct command *cmd, const char *name,
840 const char *buffer, const jsmntok_t *tok,
841 u64 **mod)
842{
843 struct amount_sat sats;
844 char *arg_str, *err;
845
846 *mod = tal(cmd, u64);
847 arg_str = tal_strndup(cmd, buffer + tok->start,
848 tok->end - tok->start);
849
850 err = u64_option(arg_str, *mod);
851 if (err) {
852 tal_free(err);
853 if (!parse_amount_sat(&sats, arg_str, strlen(arg_str)))
854 return command_fail_badparam(cmd, name,
855 buffer, tok, err);
856
857 **mod = sats.satoshis; /* Raw: convert to u64 */
858 }
859
860 return NULL;
861}
862
863static struct command_result *
864parse_lease_rates(struct command *cmd, const char *buffer,

Callers

nothing calls this directly

Calls 4

u64_optionFunction · 0.85
tal_freeFunction · 0.85
command_fail_badparamFunction · 0.85
parse_amount_satFunction · 0.50

Tested by

no test coverage detected