Browse Source

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>
ppa-0.6.1
Christian Decker 7 years ago
committed by Rusty Russell
parent
commit
a90502d917
  1. 9
      lightningd/peer_control.c

9
lightningd/peer_control.c

@ -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…
Cancel
Save