diff --git a/doc/PLUGINS.md b/doc/PLUGINS.md index ac115d8c2..d2e39110e 100644 --- a/doc/PLUGINS.md +++ b/doc/PLUGINS.md @@ -339,6 +339,20 @@ into a block. } ``` +### `channel_open_failed` + +A notification to indicate that a channel open attempt has been unsuccessful. +Useful for cleaning up state for a v2 channel open attempt. See +`tests/plugins/df_accepter.py` for an example of how to use this. + +```json +{ + "channel_open_failed": { + "channel_id": "a2d0851832f0e30a0cf...", + } +} +``` + ### `channel_state_changed` A notification for topic `channel_state_changed` is sent every time a channel diff --git a/lightningd/dual_open_control.c b/lightningd/dual_open_control.c index 8ece469cb..cd1982d8a 100644 --- a/lightningd/dual_open_control.c +++ b/lightningd/dual_open_control.c @@ -2450,6 +2450,7 @@ static void handle_commit_received(struct subd *dualopend, "Bad WIRE_DUALOPEND_COMMIT_RCVD: %s", tal_hex(msg, msg)); channel->open_attempt = tal_free(channel->open_attempt); + notify_channel_open_failed(channel->peer->ld, &channel->cid); return; }