| 585 | } |
| 586 | |
| 587 | static void openingd_failed(struct subd *openingd, const u8 *msg, |
| 588 | struct uncommitted_channel *uc) |
| 589 | { |
| 590 | char *desc; |
| 591 | |
| 592 | /* Since we're detaching from uc, we'll be unreferenced until |
| 593 | * our imminent exit (as will our parent, openingd->conn). */ |
| 594 | notleak(openingd); |
| 595 | /* openingd->conn is set to NULL temporarily for this call, so: */ |
| 596 | notleak(tal_parent(openingd)); |
| 597 | |
| 598 | if (!fromwire_openingd_failed(msg, msg, &desc)) { |
| 599 | log_broken(uc->log, |
| 600 | "bad OPENINGD_FAILED %s", |
| 601 | tal_hex(tmpctx, msg)); |
| 602 | if (uc->fc) |
| 603 | was_pending(command_fail(uc->fc->cmd, LIGHTNINGD, |
| 604 | "bad OPENINGD_FAILED %s", |
| 605 | tal_hex(uc->fc->cmd, msg))); |
| 606 | tal_free(uc); |
| 607 | return; |
| 608 | } |
| 609 | |
| 610 | /* Noop if we're not funder. */ |
| 611 | opening_funder_failed_cancel_commands(uc, desc); |
| 612 | /* Detaches from ->peer */ |
| 613 | tal_free(uc); |
| 614 | } |
| 615 | |
| 616 | struct openchannel_hook_payload { |
| 617 | struct subd *openingd; |
no test coverage detected