After channeld have all the signatures it sends the result to us here */
| 644 | |
| 645 | /* After channeld have all the signatures it sends the result to us here */ |
| 646 | static void handle_splice_confirmed_signed(struct lightningd *ld, |
| 647 | struct channel *channel, |
| 648 | const u8 *msg) |
| 649 | { |
| 650 | struct splice_command *cc; |
| 651 | struct bitcoin_tx *tx; |
| 652 | struct bitcoin_txid txid; |
| 653 | struct channel_inflight *inflight; |
| 654 | u32 output_index; |
| 655 | |
| 656 | if (!fromwire_channeld_splice_confirmed_signed(tmpctx, msg, &tx, |
| 657 | &output_index)) { |
| 658 | |
| 659 | channel_internal_error(channel, |
| 660 | "bad splice_confirmed_signed %s", |
| 661 | tal_hex(channel, msg)); |
| 662 | return; |
| 663 | } |
| 664 | |
| 665 | bitcoin_txid(tx, &txid); |
| 666 | inflight = channel_inflight_find(channel, &txid); |
| 667 | if (!inflight) |
| 668 | channel_internal_error(channel, "Unable to load inflight for" |
| 669 | " splice_confirmed_signed txid %s", |
| 670 | fmt_bitcoin_txid(tmpctx, &txid)); |
| 671 | |
| 672 | inflight->remote_tx_sigs = true; |
| 673 | wallet_inflight_save(ld->wallet, inflight); |
| 674 | |
| 675 | if (channel->state != CHANNELD_AWAITING_SPLICE) { |
| 676 | log_debug(channel->log, |
| 677 | "Would broadcast splice, but state %s" |
| 678 | " isn't CHANNELD_AWAITING_SPLICE", |
| 679 | channel_state_name(channel)); |
| 680 | return; |
| 681 | } |
| 682 | |
| 683 | cc = splice_command_for_chan(ld, channel); |
| 684 | |
| 685 | send_splice_tx(channel, tx, cc, output_index, inflight->funding_psbt); |
| 686 | } |
| 687 | |
| 688 | static enum watch_result splice_depth_cb(struct lightningd *ld, |
| 689 | unsigned int depth, |
no test coverage detected