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

Function json_funderupdate

plugins/funder.c:931–1035  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

929}
930
931static struct command_result *
932json_funderupdate(struct command *cmd,
933 const char *buf,
934 const jsmntok_t *params)
935{
936 struct amount_sat *min_their_funding, *max_their_funding,
937 *per_channel_min, *per_channel_max,
938 *reserve_tank, *lease_fee_sats;
939 struct amount_msat *channel_fee_msats;
940 u32 *fuzz_factor, *fund_probability, *chan_fee_ppt,
941 *lease_fee_basis, *funding_weight;
942 u64 *mod;
943 bool *leases_only;
944 enum funder_opt *opt;
945 const struct out_req *req;
946 const char *err;
947 struct command_result *res;
948 struct funder_policy *policy = tal(cmd, struct funder_policy);
949
950 if (!param(cmd, buf, params,
951 p_opt_def("policy", param_funder_opt, &opt,
952 current_policy->opt),
953 p_opt_def("policy_mod", param_policy_mod, &mod,
954 current_policy->mod),
955 p_opt_def("leases_only", param_bool, &leases_only,
956 current_policy->leases_only),
957 p_opt_def("min_their_funding_msat", param_msat_as_sat,
958 &min_their_funding,
959 current_policy->min_their_funding),
960 p_opt_def("max_their_funding_msat", param_msat_as_sat,
961 &max_their_funding,
962 current_policy->max_their_funding),
963 p_opt_def("per_channel_min_msat", param_msat_as_sat,
964 &per_channel_min,
965 current_policy->per_channel_min),
966 p_opt_def("per_channel_max_msat", param_msat_as_sat,
967 &per_channel_max,
968 current_policy->per_channel_max),
969 p_opt_def("reserve_tank_msat", param_msat_as_sat, &reserve_tank,
970 current_policy->reserve_tank),
971 p_opt_def("fuzz_percent", param_number,
972 &fuzz_factor,
973 current_policy->fuzz_factor),
974 p_opt_def("fund_probability", param_number,
975 &fund_probability,
976 current_policy->fund_probability),
977 p_opt("lease_fee_base_msat", param_msat_as_sat, &lease_fee_sats),
978 p_opt("lease_fee_basis", param_number, &lease_fee_basis),
979 p_opt("funding_weight", param_number, &funding_weight),
980 p_opt("channel_fee_max_base_msat", param_msat,
981 &channel_fee_msats),
982 p_opt("channel_fee_max_proportional_thousandths",
983 param_number, &chan_fee_ppt),
984 NULL))
985 return command_param_failed();
986
987 policy->opt = *opt;
988 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