| 329 | } |
| 330 | |
| 331 | static void opening_funder_start_replied(struct subd *openingd, const u8 *resp, |
| 332 | const int *fds, |
| 333 | struct funding_channel *fc) |
| 334 | { |
| 335 | bool supports_shutdown_script; |
| 336 | |
| 337 | /* It will tell us the resulting channel type (which can vary |
| 338 | * by ZEROCONF and SCID_ALIAS), so free old one */ |
| 339 | tal_free(fc->channel_type); |
| 340 | |
| 341 | if (!fromwire_openingd_funder_start_reply(fc, resp, |
| 342 | &fc->funding_scriptpubkey, |
| 343 | &supports_shutdown_script, |
| 344 | &fc->channel_type)) { |
| 345 | log_broken(fc->uc->log, |
| 346 | "bad OPENING_FUNDER_REPLY %s", |
| 347 | tal_hex(resp, resp)); |
| 348 | was_pending(command_fail(fc->cmd, LIGHTNINGD, |
| 349 | "bad OPENING_FUNDER_REPLY %s", |
| 350 | tal_hex(fc->cmd, resp))); |
| 351 | goto failed; |
| 352 | } |
| 353 | |
| 354 | /* If we're not using the upfront shutdown script, forget it */ |
| 355 | if (!supports_shutdown_script) |
| 356 | fc->our_upfront_shutdown_script = |
| 357 | tal_free(fc->our_upfront_shutdown_script); |
| 358 | |
| 359 | funding_started_success(fc); |
| 360 | |
| 361 | /* Mark that we're in-flight */ |
| 362 | fc->inflight = true; |
| 363 | return; |
| 364 | |
| 365 | failed: |
| 366 | /* Frees fc too */ |
| 367 | tal_free(fc->uc); |
| 368 | } |
| 369 | |
| 370 | static void opening_funder_finished(struct subd *openingd, const u8 *resp, |
| 371 | const int *fds, |
no test coverage detected