| 1462 | }; |
| 1463 | |
| 1464 | static void tell_lightningd_lease_rates(struct command *init_cmd, |
| 1465 | struct lease_rates *rates) |
| 1466 | { |
| 1467 | struct json_out *jout; |
| 1468 | struct amount_msat mval; |
| 1469 | |
| 1470 | /* Tell lightningd with our lease rates*/ |
| 1471 | jout = json_out_new(NULL); |
| 1472 | json_out_start(jout, NULL, '{'); |
| 1473 | |
| 1474 | mval = amount_msat(rates->lease_fee_base_sat * 1000); |
| 1475 | json_out_addstr(jout, "lease_fee_base_msat", |
| 1476 | fmt_amount_msat(tmpctx, mval)); |
| 1477 | json_out_add(jout, "lease_fee_basis", false, |
| 1478 | "%d", rates->lease_fee_basis); |
| 1479 | |
| 1480 | json_out_add(jout, "funding_weight", false, |
| 1481 | "%d", rates->funding_weight); |
| 1482 | |
| 1483 | mval = amount_msat(rates->channel_fee_max_base_msat); |
| 1484 | json_out_addstr(jout, "channel_fee_max_base_msat", |
| 1485 | fmt_amount_msat(tmpctx, mval)); |
| 1486 | json_out_add(jout, "channel_fee_max_proportional_thousandths", false, |
| 1487 | "%d", rates->channel_fee_max_proportional_thousandths); |
| 1488 | |
| 1489 | json_out_end(jout, '}'); |
| 1490 | json_out_finished(jout); |
| 1491 | |
| 1492 | rpc_scan(init_cmd, "setleaserates", take(jout), |
| 1493 | /* Unused */ |
| 1494 | "{lease_fee_base_msat:%}", |
| 1495 | JSON_SCAN(json_to_msat, &mval)); |
| 1496 | |
| 1497 | } |
| 1498 | |
| 1499 | static void memleak_mark(struct plugin *p, struct htable *memtable) |
| 1500 | { |
no test coverage detected