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

Function next_funding_feerate

bitcoin/feerate.c:41–63  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

39}
40
41bool next_funding_feerate(u32 last_feerate, u32 *next_feerate)
42{
43 u64 next;
44
45 /* Not a feerate we could ever have proposed, and 25/24 of it is
46 * still 0. */
47 if (last_feerate == 0)
48 return false;
49
50 /* Widen: anything above UINT_MAX/25 overflows a u32 here, and that
51 * is exactly the range a broken fee estimator can leave in the db. */
52 next = (u64)last_feerate * 25 / 24;
53 if (next > UINT_MAX)
54 return false;
55
56 /* Rounding down means feerates below 24 map back onto themselves,
57 * and the rule requires strictly more to be a valid bump. */
58 if (next <= last_feerate)
59 return false;
60
61 *next_feerate = next;
62 return true;
63}
64
65const char *feerate_style_name(enum feerate_style style)
66{

Callers 2

json_openchannel_bumpFunction · 0.85
check_funding_feerateFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected