mirror of
https://github.com/ElementsProject/lightning.git
synced 2025-03-03 18:57:06 +01:00
df: differentiate error message between
There's a difference between "no channel" and "channel in progress but no open available to cancel"
This commit is contained in:
parent
4ae9e0c73f
commit
260adb824e
1 changed files with 6 additions and 2 deletions
|
@ -1935,9 +1935,13 @@ json_openchannel_abort(struct command *cmd,
|
||||||
return command_fail(cmd, FUNDING_PEER_NOT_CONNECTED,
|
return command_fail(cmd, FUNDING_PEER_NOT_CONNECTED,
|
||||||
"Peer not connected");
|
"Peer not connected");
|
||||||
|
|
||||||
if (!channel->open_attempt)
|
if (!channel->open_attempt) {
|
||||||
|
if (list_empty(&channel->inflights))
|
||||||
|
return command_fail(cmd, FUNDING_STATE_INVALID,
|
||||||
|
"Channel open not in progress");
|
||||||
return command_fail(cmd, FUNDING_STATE_INVALID,
|
return command_fail(cmd, FUNDING_STATE_INVALID,
|
||||||
"Channel open not in progress");
|
"Sigs already exchanged, can't cancel");
|
||||||
|
}
|
||||||
|
|
||||||
if (channel->open_attempt->cmd)
|
if (channel->open_attempt->cmd)
|
||||||
return command_fail(cmd, FUNDING_STATE_INVALID,
|
return command_fail(cmd, FUNDING_STATE_INVALID,
|
||||||
|
|
Loading…
Add table
Reference in a new issue