| 3939 | }; |
| 3940 | |
| 3941 | static void process_dev_forget_channel(struct bitcoind *bitcoind UNUSED, |
| 3942 | const struct bitcoin_tx_output *txout, |
| 3943 | void *arg) |
| 3944 | { |
| 3945 | struct json_stream *response; |
| 3946 | struct dev_forget_channel_cmd *forget = arg; |
| 3947 | if (txout != NULL && !forget->force) { |
| 3948 | was_pending(command_fail(forget->cmd, LIGHTNINGD, |
| 3949 | "Cowardly refusing to forget channel with an " |
| 3950 | "unspent funding output, if you know what " |
| 3951 | "you're doing you can override with " |
| 3952 | "`force=true`, otherwise consider `close` or " |
| 3953 | "`dev-fail`! If you force and the channel " |
| 3954 | "confirms we will not track the funds in the " |
| 3955 | "channel")); |
| 3956 | return; |
| 3957 | } |
| 3958 | response = json_stream_success(forget->cmd); |
| 3959 | json_add_bool(response, "forced", forget->force); |
| 3960 | json_add_bool(response, "funding_unspent", txout != NULL); |
| 3961 | json_add_txid(response, "funding_txid", &forget->channel->funding.txid); |
| 3962 | |
| 3963 | /* Set error so we don't try to reconnect. */ |
| 3964 | forget->channel->error = towire_errorfmt(forget->channel, |
| 3965 | &forget->channel->cid, |
| 3966 | "dev_forget_channel"); |
| 3967 | delete_channel(forget->channel, false); |
| 3968 | |
| 3969 | was_pending(command_success(forget->cmd, response)); |
| 3970 | } |
| 3971 | |
| 3972 | static struct command_result *json_dev_forget_channel(struct command *cmd, |
| 3973 | const char *buffer, |
nothing calls this directly
no test coverage detected