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

Function json_add_policy

plugins/funder.c:1247–1274  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1245}
1246
1247static void json_add_policy(struct json_stream *stream,
1248 struct funder_policy *policy)
1249{
1250 json_add_string(stream, "summary",
1251 funder_policy_desc(stream, current_policy));
1252 json_add_string(stream, "policy",
1253 funder_opt_name(policy->opt));
1254 json_add_num(stream, "policy_mod", policy->mod);
1255 json_add_bool(stream, "leases_only", policy->leases_only);
1256 json_add_amount_sat_msat(stream, "min_their_funding_msat",
1257 policy->min_their_funding);
1258 json_add_amount_sat_msat(stream, "max_their_funding_msat",
1259 policy->max_their_funding);
1260 json_add_amount_sat_msat(stream, "per_channel_min_msat",
1261 policy->per_channel_min);
1262 json_add_amount_sat_msat(stream, "per_channel_max_msat",
1263 policy->per_channel_max);
1264 json_add_amount_sat_msat(stream, "reserve_tank_msat",
1265 policy->reserve_tank);
1266 json_add_num(stream, "fuzz_percent", policy->fuzz_factor);
1267 json_add_num(stream, "fund_probability", policy->fund_probability);
1268
1269 if (policy->rates) {
1270 json_add_lease_rates(stream, policy->rates);
1271 json_add_string(stream, "compact_lease",
1272 lease_rates_tohex(tmpctx, policy->rates));
1273 }
1274}
1275
1276static struct command_result *
1277param_funder_opt(struct command *cmd, const char *name,

Callers 1

leaserates_setFunction · 0.85

Calls 8

funder_policy_descFunction · 0.85
funder_opt_nameFunction · 0.85
json_add_numFunction · 0.85
json_add_boolFunction · 0.85
json_add_amount_sat_msatFunction · 0.85
json_add_lease_ratesFunction · 0.85
lease_rates_tohexFunction · 0.85
json_add_stringFunction · 0.50

Tested by

no test coverage detected