mirror of
https://github.com/ElementsProject/lightning.git
synced 2025-03-01 17:47:30 +01:00
openingd: return more informative error message for v2 opens
Fixes #4562 Reported-By: William Casarin @jb55 New error message: zircon:lightning (nifty/fix-4562)$ l1-cli fundchannel_start 03fce775508719e4064b7f19d4e884ddaf51db23bbfc560286ce872f9ed106fee0 10000 253perkw { "code": 312, "message": "Peer negotiated `option_dual_fund`, must use `openchannel_init` not `fundchannel_start`." }
This commit is contained in:
parent
e95fc74884
commit
cead5e16c0
1 changed files with 9 additions and 0 deletions
|
@ -1177,6 +1177,15 @@ static struct command_result *json_fundchannel_start(struct command *cmd,
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!peer->uncommitted_channel) {
|
if (!peer->uncommitted_channel) {
|
||||||
|
if (feature_negotiated(cmd->ld->our_features,
|
||||||
|
peer->their_features,
|
||||||
|
OPT_DUAL_FUND))
|
||||||
|
return command_fail(cmd, FUNDING_STATE_INVALID,
|
||||||
|
"Peer negotiated"
|
||||||
|
" `option_dual_fund`,"
|
||||||
|
" must use `openchannel_init` not"
|
||||||
|
" `fundchannel_start`.");
|
||||||
|
|
||||||
return command_fail(cmd, FUNDING_PEER_NOT_CONNECTED,
|
return command_fail(cmd, FUNDING_PEER_NOT_CONNECTED,
|
||||||
"Peer not connected");
|
"Peer not connected");
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue