| 2144 | }; |
| 2145 | |
| 2146 | static void process_check_funding_broadcast(struct bitcoind *bitcoind, |
| 2147 | const struct bitcoin_tx_output *txout, |
| 2148 | void *arg) |
| 2149 | { |
| 2150 | struct channel_to_cancel *cc = arg; |
| 2151 | struct peer *peer; |
| 2152 | struct channel *cancel; |
| 2153 | |
| 2154 | /* Peer could have errored out while we were waiting */ |
| 2155 | peer = peer_by_id(bitcoind->ld, &cc->peer); |
| 2156 | if (!peer) |
| 2157 | goto cleanup; |
| 2158 | cancel = find_channel_by_id(peer, &cc->cid); |
| 2159 | if (!cancel) |
| 2160 | goto cleanup; |
| 2161 | |
| 2162 | if (txout != NULL) { |
| 2163 | for (size_t i = 0; i < tal_count(cancel->forgets); i++) |
| 2164 | was_pending(command_fail(cancel->forgets[i], |
| 2165 | FUNDING_CANCEL_NOT_SAFE, |
| 2166 | "The funding transaction has been broadcast, " |
| 2167 | "please consider `close` or `dev-fail`! ")); |
| 2168 | tal_free(cancel->forgets); |
| 2169 | cancel->forgets = tal_arr(cancel, struct command *, 0); |
| 2170 | goto cleanup; |
| 2171 | } |
| 2172 | |
| 2173 | char *error_reason = "Cancel channel by our RPC " |
| 2174 | "command before funding " |
| 2175 | "transaction broadcast."; |
| 2176 | forget_channel(cancel, error_reason); |
| 2177 | |
| 2178 | cleanup: |
| 2179 | tal_free(cc); |
| 2180 | return; |
| 2181 | } |
| 2182 | |
| 2183 | struct command_result *cancel_channel_before_broadcast(struct command *cmd, |
| 2184 | struct peer *peer) |
nothing calls this directly
no test coverage detected