When channeld finishes processing the `splice_init` command, this is called */
| 400 | |
| 401 | /* When channeld finishes processing the `splice_init` command, this is called */ |
| 402 | static void handle_splice_confirmed_init(struct lightningd *ld, |
| 403 | struct channel *channel, |
| 404 | const u8 *msg) |
| 405 | { |
| 406 | struct splice_command *cc; |
| 407 | struct wally_psbt *psbt; |
| 408 | |
| 409 | if (!fromwire_channeld_splice_confirmed_init(tmpctx, msg, &psbt)) { |
| 410 | channel_internal_error(channel, |
| 411 | "bad splice_confirmed_init %s", |
| 412 | tal_hex(channel, msg)); |
| 413 | return; |
| 414 | } |
| 415 | |
| 416 | cc = splice_command_for_chan(ld, channel); |
| 417 | if (!cc) { |
| 418 | channel_internal_error(channel, "splice_confirmed_init" |
| 419 | " received without an active command %s", |
| 420 | tal_hex(channel, msg)); |
| 421 | return; |
| 422 | } |
| 423 | |
| 424 | if (psbt->version != cc->user_psbt_ver |
| 425 | && !psbt_set_version(psbt, cc->user_psbt_ver)) |
| 426 | channel_internal_error(channel, "Splice failed to convert from" |
| 427 | " internal version "PRIu32" to user" |
| 428 | " version "PRIu32, psbt->version, |
| 429 | cc->user_psbt_ver); |
| 430 | |
| 431 | struct json_stream *response = json_stream_success(cc->cmd); |
| 432 | json_add_string(response, "psbt", fmt_wally_psbt(tmpctx, psbt)); |
| 433 | |
| 434 | was_pending(command_success(cc->cmd, response)); |
| 435 | } |
| 436 | |
| 437 | /* Channeld sends us this in response to a user's `splice_update` request */ |
| 438 | static void handle_splice_confirmed_update(struct lightningd *ld, |
no test coverage detected