| 2927 | }; |
| 2928 | |
| 2929 | static void process_dev_forget_channel(struct bitcoind *bitcoind UNUSED, |
| 2930 | const struct bitcoin_tx_output *txout, |
| 2931 | void *arg) |
| 2932 | { |
| 2933 | struct json_stream *response; |
| 2934 | struct dev_forget_channel_cmd *forget = arg; |
| 2935 | if (txout != NULL && !forget->force) { |
| 2936 | was_pending(command_fail(forget->cmd, LIGHTNINGD, |
| 2937 | "Cowardly refusing to forget channel with an " |
| 2938 | "unspent funding output, if you know what " |
| 2939 | "you're doing you can override with " |
| 2940 | "`force=true`, otherwise consider `close` or " |
| 2941 | "`dev-fail`! If you force and the channel " |
| 2942 | "confirms we will not track the funds in the " |
| 2943 | "channel")); |
| 2944 | return; |
| 2945 | } |
| 2946 | response = json_stream_success(forget->cmd); |
| 2947 | json_add_bool(response, "forced", forget->force); |
| 2948 | json_add_bool(response, "funding_unspent", txout != NULL); |
| 2949 | json_add_txid(response, "funding_txid", &forget->channel->funding.txid); |
| 2950 | |
| 2951 | /* Set error so we don't try to reconnect. */ |
| 2952 | forget->channel->error = towire_errorfmt(forget->channel, |
| 2953 | &forget->channel->cid, |
| 2954 | "dev_forget_channel"); |
| 2955 | delete_channel(forget->channel); |
| 2956 | |
| 2957 | was_pending(command_success(forget->cmd, response)); |
| 2958 | } |
| 2959 | |
| 2960 | static struct command_result *json_dev_forget_channel(struct command *cmd, |
| 2961 | const char *buffer, |
nothing calls this directly
no test coverage detected