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