| 143 | } |
| 144 | |
| 145 | static void set_reserve_absolute(struct state * state, const struct amount_sat dust_limit, struct amount_sat reserve_sat) |
| 146 | { |
| 147 | status_debug("Setting their reserve to %s", |
| 148 | type_to_string(tmpctx, struct amount_sat, &reserve_sat)); |
| 149 | if (state->allowdustreserve) { |
| 150 | state->localconf.channel_reserve = reserve_sat; |
| 151 | } else { |
| 152 | /* BOLT #2: |
| 153 | * |
| 154 | * The sending node: |
| 155 | *... |
| 156 | * - MUST set `channel_reserve_satoshis` greater than or equal |
| 157 | *to `dust_limit_satoshis` from the `open_channel` message. |
| 158 | */ |
| 159 | if (amount_sat_greater(dust_limit, reserve_sat)) { |
| 160 | status_debug("Their reserve is too small, bumping to " |
| 161 | "dust_limit: %s < %s", |
| 162 | type_to_string(tmpctx, struct amount_sat, |
| 163 | &reserve_sat), |
| 164 | type_to_string(tmpctx, struct amount_sat, |
| 165 | &dust_limit)); |
| 166 | state->localconf.channel_reserve = dust_limit; |
| 167 | } else { |
| 168 | state->localconf.channel_reserve = reserve_sat; |
| 169 | } |
| 170 | } |
| 171 | } |
| 172 | |
| 173 | /* We always set channel_reserve_satoshis to 1%, rounded down. */ |
| 174 | static void set_reserve(struct state *state, const struct amount_sat dust_limit) |
no test coverage detected