| 39 | } |
| 40 | |
| 41 | bool 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 | |
| 65 | const char *feerate_style_name(enum feerate_style style) |
| 66 | { |
no outgoing calls
no test coverage detected