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

Function json_funderupdate

plugins/funder.c:1390–1494  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1388}
1389
1390static struct command_result *
1391json_funderupdate(struct command *cmd,
1392 const char *buf,
1393 const jsmntok_t *params)
1394{
1395 struct amount_sat *min_their_funding, *max_their_funding,
1396 *per_channel_min, *per_channel_max,
1397 *reserve_tank, *lease_fee_sats;
1398 struct amount_msat *channel_fee_msats;
1399 u32 *fuzz_factor, *fund_probability, *chan_fee_ppt,
1400 *lease_fee_basis, *funding_weight;
1401 u64 *mod;
1402 bool *leases_only;
1403 enum funder_opt *opt;
1404 const struct out_req *req;
1405 const char *err;
1406 struct command_result *res;
1407 struct funder_policy *policy = tal(cmd, struct funder_policy);
1408
1409 if (!param(cmd, buf, params,
1410 p_opt_def("policy", param_funder_opt, &opt,
1411 current_policy->opt),
1412 p_opt_def("policy_mod", param_policy_mod, &mod,
1413 current_policy->mod),
1414 p_opt_def("leases_only", param_bool, &leases_only,
1415 current_policy->leases_only),
1416 p_opt_def("min_their_funding_msat", param_msat_as_sat,
1417 &min_their_funding,
1418 current_policy->min_their_funding),
1419 p_opt_def("max_their_funding_msat", param_msat_as_sat,
1420 &max_their_funding,
1421 current_policy->max_their_funding),
1422 p_opt_def("per_channel_min_msat", param_msat_as_sat,
1423 &per_channel_min,
1424 current_policy->per_channel_min),
1425 p_opt_def("per_channel_max_msat", param_msat_as_sat,
1426 &per_channel_max,
1427 current_policy->per_channel_max),
1428 p_opt_def("reserve_tank_msat", param_msat_as_sat, &reserve_tank,
1429 current_policy->reserve_tank),
1430 p_opt_def("fuzz_percent", param_number,
1431 &fuzz_factor,
1432 current_policy->fuzz_factor),
1433 p_opt_def("fund_probability", param_number,
1434 &fund_probability,
1435 current_policy->fund_probability),
1436 p_opt("lease_fee_base_msat", param_msat_as_sat, &lease_fee_sats),
1437 p_opt("lease_fee_basis", param_number, &lease_fee_basis),
1438 p_opt("funding_weight", param_number, &funding_weight),
1439 p_opt("channel_fee_max_base_msat", param_msat,
1440 &channel_fee_msats),
1441 p_opt("channel_fee_max_proportional_thousandths",
1442 param_number, &chan_fee_ppt),
1443 NULL))
1444 return command_param_failed();
1445
1446 policy->opt = *opt;
1447 policy->mod = *mod;

Callers

nothing calls this directly

Calls 8

parse_lease_ratesFunction · 0.85
funder_check_policyFunction · 0.85
tal_freeFunction · 0.85
command_done_errFunction · 0.85
json_add_lease_ratesFunction · 0.85
command_param_failedFunction · 0.70
send_outreqFunction · 0.70
paramFunction · 0.50

Tested by

no test coverage detected