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

Function param_policy_mod

plugins/funder.c:1256–1279  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1254
1255
1256static struct command_result *
1257param_policy_mod(struct command *cmd, const char *name,
1258 const char *buffer, const jsmntok_t *tok,
1259 u64 **mod)
1260{
1261 struct amount_sat sats;
1262 char *arg_str, *err;
1263
1264 *mod = tal(cmd, u64);
1265 arg_str = tal_strndup(cmd, buffer + tok->start,
1266 tok->end - tok->start);
1267
1268 err = u64_option(cmd, arg_str, false, *mod);
1269 if (err) {
1270 tal_free(err);
1271 if (!parse_amount_sat(&sats, arg_str, strlen(arg_str)))
1272 return command_fail_badparam(cmd, name,
1273 buffer, tok, err);
1274
1275 **mod = sats.satoshis; /* Raw: convert to u64 */
1276 }
1277
1278 return NULL;
1279}
1280
1281static struct command_result *
1282parse_lease_rates(struct command *cmd, const char *buffer,

Callers

nothing calls this directly

Calls 4

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

Tested by

no test coverage detected