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

Function param_policy_mod

plugins/funder.c:1295–1318  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1293
1294
1295static struct command_result *
1296param_policy_mod(struct command *cmd, const char *name,
1297 const char *buffer, const jsmntok_t *tok,
1298 u64 **mod)
1299{
1300 struct amount_sat sats;
1301 char *arg_str, *err;
1302
1303 *mod = tal(cmd, u64);
1304 arg_str = tal_strndup(cmd, buffer + tok->start,
1305 tok->end - tok->start);
1306
1307 err = u64_option(cmd, arg_str, false, *mod);
1308 if (err) {
1309 tal_free(err);
1310 if (!parse_amount_sat(&sats, arg_str, strlen(arg_str)))
1311 return command_fail_badparam(cmd, name,
1312 buffer, tok, err);
1313
1314 **mod = sats.satoshis; /* Raw: convert to u64 */
1315 }
1316
1317 return NULL;
1318}
1319
1320static struct command_result *
1321parse_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