| 302 | } |
| 303 | |
| 304 | static void funding_started_success(struct funding_channel *fc) |
| 305 | { |
| 306 | struct json_stream *response; |
| 307 | struct command *cmd = fc->cmd; |
| 308 | char *out; |
| 309 | |
| 310 | response = json_stream_success(cmd); |
| 311 | out = encode_scriptpubkey_to_addr(cmd, |
| 312 | chainparams, |
| 313 | fc->funding_scriptpubkey, |
| 314 | tal_bytelen(fc->funding_scriptpubkey)); |
| 315 | if (out) { |
| 316 | json_add_string(response, "funding_address", out); |
| 317 | json_add_hex_talarr(response, "scriptpubkey", |
| 318 | fc->funding_scriptpubkey); |
| 319 | if (fc->our_upfront_shutdown_script) |
| 320 | json_add_hex_talarr(response, "close_to", fc->our_upfront_shutdown_script); |
| 321 | json_add_channel_type(response, "channel_type", fc->channel_type); |
| 322 | json_add_string(response, "warning_usage", |
| 323 | "The funding transaction MUST NOT be broadcast until after channel establishment has been successfully completed by running `fundchannel_complete`"); |
| 324 | } |
| 325 | |
| 326 | /* Clear this so cancel doesn't think it's still in progress */ |
| 327 | fc->cmd = NULL; |
| 328 | was_pending(command_success(cmd, response)); |
| 329 | } |
| 330 | |
| 331 | static void opening_funder_start_replied(struct subd *openingd, const u8 *resp, |
| 332 | const int *fds, |
no test coverage detected