2021-12-04 12:23:56 +01:00
|
|
|
#include "config.h"
|
2017-08-28 18:05:01 +02:00
|
|
|
#include <common/channel_config.h>
|
2017-02-07 02:44:21 +01:00
|
|
|
#include <wire/wire.h>
|
|
|
|
|
|
|
|
void towire_channel_config(u8 **pptr, const struct channel_config *config)
|
|
|
|
{
|
2019-02-21 04:45:54 +01:00
|
|
|
towire_amount_sat(pptr, config->dust_limit);
|
|
|
|
towire_amount_msat(pptr, config->max_htlc_value_in_flight);
|
|
|
|
towire_amount_sat(pptr, config->channel_reserve);
|
|
|
|
towire_amount_msat(pptr, config->htlc_minimum);
|
2017-02-07 02:44:21 +01:00
|
|
|
towire_u16(pptr, config->to_self_delay);
|
|
|
|
towire_u16(pptr, config->max_accepted_htlcs);
|
2021-09-28 21:03:08 +02:00
|
|
|
towire_amount_msat(pptr, config->max_dust_htlc_exposure_msat);
|
2017-02-07 02:44:21 +01:00
|
|
|
}
|
|
|
|
|
2017-02-21 05:45:19 +01:00
|
|
|
void fromwire_channel_config(const u8 **ptr, size_t *max,
|
|
|
|
struct channel_config *config)
|
2017-02-07 02:44:21 +01:00
|
|
|
{
|
2019-02-21 04:45:54 +01:00
|
|
|
config->dust_limit = fromwire_amount_sat(ptr, max);
|
|
|
|
config->max_htlc_value_in_flight = fromwire_amount_msat(ptr, max);
|
|
|
|
config->channel_reserve = fromwire_amount_sat(ptr, max);
|
|
|
|
config->htlc_minimum = fromwire_amount_msat(ptr, max);
|
2017-02-07 02:44:21 +01:00
|
|
|
config->to_self_delay = fromwire_u16(ptr, max);
|
|
|
|
config->max_accepted_htlcs = fromwire_u16(ptr, max);
|
2021-09-28 21:03:08 +02:00
|
|
|
config->max_dust_htlc_exposure_msat = fromwire_amount_msat(ptr, max);
|
2017-02-07 02:44:21 +01:00
|
|
|
}
|