df: add a new 'channel_open_failed' notification

Let plugins know when a channel open has failed.

We need to notify accepters now too, so we remove the check on who's
funding the channel before sending the 'failed' message from
dualopend->master.
This commit is contained in:
niftynei
2020-12-17 15:28:51 -06:00
committed by Christian Decker
parent d4ec052668
commit 2cd95aa806
4 changed files with 60 additions and 41 deletions

View File

@@ -1133,13 +1133,16 @@ static void open_failed(struct subd *dualopend, const u8 *msg)
log_broken(uc->log,
"Bad DUALOPEND_FAILED %s",
tal_hex(msg, msg));
if (uc->fc && uc->fc->cmd)
was_pending(command_fail(uc->fc->cmd, LIGHTNINGD, "%s",
tal_hex(uc->fc->cmd, msg)));
notify_channel_open_failed(dualopend->ld, &uc->cid);
tal_free(uc);
}
notify_channel_open_failed(dualopend->ld, &uc->cid);
opening_failed_cancel_commands(uc, desc);
}