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

Function default_feerate

lightningd/channel_control.c:54–76  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

52};
53
54static u32 default_feerate(struct lightningd *ld, const struct channel *channel,
55 bool add_offset)
56{
57 u32 max_feerate;
58 bool anchors = channel_type_has_anchors(channel->type);
59 u32 feerate = unilateral_feerate(ld->topology, anchors);
60
61 /* Nothing to do if we don't know feerate. */
62 if (!feerate)
63 return 0;
64
65 max_feerate = feerate_max(ld, NULL);
66
67 /* The channel opener should use a slightly higher than minimal feerate
68 * in order to avoid excessive feerate disagreements */
69 if (channel->opener == LOCAL) {
70 feerate += ld->config.feerate_offset;
71 if (feerate > max_feerate)
72 feerate = max_feerate;
73 }
74
75 return feerate;
76}
77
78void channel_update_feerates(struct lightningd *ld, const struct channel *channel)
79{

Callers 1

channel_update_feeratesFunction · 0.85

Calls 3

channel_type_has_anchorsFunction · 0.85
feerate_maxFunction · 0.85
unilateral_feerateFunction · 0.70

Tested by

no test coverage detected