mirror of
https://github.com/ElementsProject/lightning.git
synced 2025-01-17 19:03:42 +01:00
jsonrpc: Refuse to forget a channel with an open HTLC
... instead provide useful suggestions as to how to close it. Signed-off-by: Christian Decker <decker.christian@gmail.com>
This commit is contained in:
parent
aef5780f36
commit
a90502d917
@ -1086,6 +1086,15 @@ static void json_dev_forget_channel(struct command *cmd, const char *buffer,
|
||||
return;
|
||||
}
|
||||
|
||||
if (channel_has_htlc_out(forget->channel) ||
|
||||
channel_has_htlc_in(forget->channel)) {
|
||||
command_fail(cmd, "This channel has HTLCs attached and it is "
|
||||
"not safe to forget it. Please use `close` "
|
||||
"or `dev-fail` instead.");
|
||||
return;
|
||||
|
||||
}
|
||||
|
||||
bitcoind_gettxout(cmd->ld->topology->bitcoind,
|
||||
&forget->channel->funding_txid,
|
||||
forget->channel->funding_outnum,
|
||||
|
Loading…
Reference in New Issue
Block a user