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