| 1047 | }; |
| 1048 | |
| 1049 | static void tell_lightningd_lease_rates(struct plugin *p, |
| 1050 | struct lease_rates *rates) |
| 1051 | { |
| 1052 | struct json_out *jout; |
| 1053 | struct amount_msat mval; |
| 1054 | |
| 1055 | /* Tell lightningd with our lease rates*/ |
| 1056 | jout = json_out_new(NULL); |
| 1057 | json_out_start(jout, NULL, '{'); |
| 1058 | |
| 1059 | mval = amount_msat(rates->lease_fee_base_sat * 1000); |
| 1060 | json_out_addstr(jout, "lease_fee_base_msat", |
| 1061 | type_to_string(tmpctx, struct amount_msat, &mval)); |
| 1062 | json_out_add(jout, "lease_fee_basis", false, |
| 1063 | "%d", rates->lease_fee_basis); |
| 1064 | |
| 1065 | json_out_add(jout, "funding_weight", false, |
| 1066 | "%d", rates->funding_weight); |
| 1067 | |
| 1068 | mval = amount_msat(rates->channel_fee_max_base_msat); |
| 1069 | json_out_addstr(jout, "channel_fee_max_base_msat", |
| 1070 | type_to_string(tmpctx, struct amount_msat, &mval)); |
| 1071 | json_out_add(jout, "channel_fee_max_proportional_thousandths", false, |
| 1072 | "%d", rates->channel_fee_max_proportional_thousandths); |
| 1073 | |
| 1074 | json_out_end(jout, '}'); |
| 1075 | json_out_finished(jout); |
| 1076 | |
| 1077 | rpc_scan(p, "setleaserates", take(jout), |
| 1078 | /* Unused */ |
| 1079 | "{lease_fee_base_msat:%}", |
| 1080 | JSON_SCAN(json_to_msat, &mval)); |
| 1081 | |
| 1082 | } |
| 1083 | |
| 1084 | #if DEVELOPER |
| 1085 | static void memleak_mark(struct plugin *p, struct htable *memtable) |
no test coverage detected