| 620 | } |
| 621 | |
| 622 | static void openingd_failed(struct subd *openingd, const u8 *msg, |
| 623 | struct uncommitted_channel *uc) |
| 624 | { |
| 625 | char *desc; |
| 626 | |
| 627 | /* Since we're detaching from uc, we'll be unreferenced until |
| 628 | * our imminent exit (as will our parent, openingd->conn). */ |
| 629 | notleak(openingd); |
| 630 | /* openingd->conn is set to NULL temporarily for this call, so: */ |
| 631 | notleak(tal_parent(openingd)); |
| 632 | |
| 633 | if (!fromwire_openingd_failed(msg, msg, &desc)) { |
| 634 | log_broken(uc->log, |
| 635 | "bad OPENINGD_FAILED %s", |
| 636 | tal_hex(tmpctx, msg)); |
| 637 | if (uc->fc) |
| 638 | was_pending(command_fail(uc->fc->cmd, LIGHTNINGD, |
| 639 | "bad OPENINGD_FAILED %s", |
| 640 | tal_hex(uc->fc->cmd, msg))); |
| 641 | tal_free(uc); |
| 642 | return; |
| 643 | } |
| 644 | |
| 645 | /* Noop if we're not funder. */ |
| 646 | opening_funder_failed_cancel_commands(uc, desc); |
| 647 | /* Detaches from ->peer */ |
| 648 | tal_free(uc); |
| 649 | } |
| 650 | |
| 651 | struct openchannel_hook_payload { |
| 652 | struct subd *openingd; |
no test coverage detected