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

Function channel_update_feerates

lightningd/channel_control.c:78–119  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

76}
77
78void channel_update_feerates(struct lightningd *ld, const struct channel *channel)
79{
80 u8 *msg;
81 u32 min_feerate, max_feerate;
82 bool anchors = channel_type_has_anchors(channel->type);
83 u32 feerate = default_feerate(ld, channel, (channel->opener == LOCAL));
84 u32 feerate_splice = splice_feerate(ld->topology, ld);
85
86 /* Nothing to do if we don't know feerate. */
87 if (!feerate)
88 return;
89
90 /* For anchors, we just need the commitment tx to relay. */
91 if (anchors)
92 min_feerate = get_feerate_floor(ld->topology);
93 else
94 min_feerate = feerate_min(ld, NULL);
95 max_feerate = feerate_max(ld, NULL);
96
97 if (channel->ignore_fee_limits || ld->config.ignore_fee_limits) {
98 min_feerate = 1;
99 max_feerate = 0xFFFFFFFF;
100 }
101
102 log_debug(ld->log,
103 "update_feerates: feerate = %u, min=%u, max=%u, penalty=%u,"
104 " opening=%u, splicing: %u",
105 feerate,
106 min_feerate,
107 feerate_max(ld, NULL),
108 penalty_feerate(ld->topology),
109 opening_feerate(ld->topology),
110 feerate_splice);
111
112 msg = towire_channeld_feerates(NULL, feerate,
113 min_feerate,
114 max_feerate,
115 penalty_feerate(ld->topology),
116 opening_feerate(ld->topology),
117 feerate_splice);
118 subd_send_msg(channel->owner, take(msg));
119}
120
121static void try_update_feerates(struct lightningd *ld, struct channel *channel)
122{

Callers 2

set_channel_configFunction · 0.70
try_update_feeratesFunction · 0.70

Calls 9

channel_type_has_anchorsFunction · 0.85
default_feerateFunction · 0.85
splice_feerateFunction · 0.85
feerate_minFunction · 0.85
feerate_maxFunction · 0.85
get_feerate_floorFunction · 0.70
penalty_feerateFunction · 0.70
opening_feerateFunction · 0.70
subd_send_msgFunction · 0.70

Tested by

no test coverage detected