| 253 | } |
| 254 | |
| 255 | static bool setup_channel_funder(struct state *state) |
| 256 | { |
| 257 | #if DEVELOPER |
| 258 | /* --dev-force-tmp-channel-id specified */ |
| 259 | if (dev_force_tmp_channel_id) |
| 260 | state->channel_id = *dev_force_tmp_channel_id; |
| 261 | #endif |
| 262 | /* BOLT #2: |
| 263 | * |
| 264 | * The sending node: |
| 265 | *... |
| 266 | * - if both nodes advertised `option_support_large_channel`: |
| 267 | * - MAY set `funding_satoshis` greater than or equal to 2^24 satoshi. |
| 268 | * - otherwise: |
| 269 | * - MUST set `funding_satoshis` to less than 2^24 satoshi. |
| 270 | */ |
| 271 | if (!feature_negotiated(state->our_features, |
| 272 | state->their_features, OPT_LARGE_CHANNELS) |
| 273 | && amount_sat_greater(state->funding_sats, |
| 274 | chainparams->max_funding)) { |
| 275 | status_failed(STATUS_FAIL_MASTER_IO, |
| 276 | "funding_satoshis must be < %s, not %s", |
| 277 | type_to_string(tmpctx, struct amount_sat, |
| 278 | &chainparams->max_funding), |
| 279 | type_to_string(tmpctx, struct amount_sat, |
| 280 | &state->funding_sats)); |
| 281 | return false; |
| 282 | } |
| 283 | |
| 284 | return true; |
| 285 | } |
| 286 | |
| 287 | static void set_remote_upfront_shutdown(struct state *state, |
| 288 | u8 *shutdown_scriptpubkey STEALS) |
no test coverage detected