mirror of
https://github.com/aljazceru/lightning.git
synced 2025-12-24 01:24:26 +01:00
lease_rates: prepare for msats fields as raw numbers.
We would otherwise multiply them by 1000. Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
This commit is contained in:
@@ -81,11 +81,14 @@ bool lease_rates_set_chan_fee_base_msat(struct lease_rates *rates,
|
||||
amt.millisatoshis); /* Raw: conversion */
|
||||
}
|
||||
|
||||
bool lease_rates_set_lease_fee_sat(struct lease_rates *rates,
|
||||
struct amount_sat amt)
|
||||
bool lease_rates_set_lease_fee_msat(struct lease_rates *rates,
|
||||
struct amount_msat amt)
|
||||
{
|
||||
struct amount_sat sat;
|
||||
if (!amount_msat_to_sat(&sat, amt))
|
||||
return false;
|
||||
return assign_overflow_u32(&rates->lease_fee_base_sat,
|
||||
amt.satoshis); /* Raw: conversion */
|
||||
sat.satoshis); /* Raw: conversion */
|
||||
}
|
||||
|
||||
char *lease_rates_tohex(const tal_t *ctx, const struct lease_rates *rates)
|
||||
|
||||
@@ -36,7 +36,8 @@ bool lease_rates_calc_fee(const struct lease_rates *rates,
|
||||
|
||||
WARN_UNUSED_RESULT bool lease_rates_set_chan_fee_base_msat(struct lease_rates *rates, struct amount_msat amt);
|
||||
|
||||
WARN_UNUSED_RESULT bool lease_rates_set_lease_fee_sat(struct lease_rates *rates, struct amount_sat amt);
|
||||
WARN_UNUSED_RESULT bool lease_rates_set_lease_fee_msat(struct lease_rates *rates,
|
||||
struct amount_msat amt);
|
||||
|
||||
/* Convert 'lease_rates' into a hexstring */
|
||||
char *lease_rates_tohex(const tal_t *ctx, const struct lease_rates *rates);
|
||||
|
||||
Reference in New Issue
Block a user