| 1637 | }; |
| 1638 | |
| 1639 | static void handle_tx_broadcast(struct channel_send *cs) |
| 1640 | { |
| 1641 | struct lightningd *ld = cs->channel->peer->ld; |
| 1642 | const struct wally_tx *wtx = cs->wtx; |
| 1643 | struct channel *channel = cs->channel; |
| 1644 | struct command *cmd = channel->openchannel_signed_cmd; |
| 1645 | struct json_stream *response; |
| 1646 | struct bitcoin_txid txid; |
| 1647 | |
| 1648 | /* This might have spent UTXOs from our wallet */ |
| 1649 | if (wallet_extract_owned_outputs(ld->wallet, |
| 1650 | /* FIXME: what txindex? */ |
| 1651 | wtx, false, NULL, NULL)) { |
| 1652 | wallet_transaction_add(ld->wallet, wtx, 0, 0); |
| 1653 | } |
| 1654 | |
| 1655 | if (cmd) { |
| 1656 | response = json_stream_success(cmd); |
| 1657 | wally_txid(wtx, &txid); |
| 1658 | json_add_hex_talarr(response, "tx", linearize_wtx(tmpctx, wtx)); |
| 1659 | json_add_txid(response, "txid", &txid); |
| 1660 | json_add_channel_id(response, "channel_id", &channel->cid); |
| 1661 | was_pending(command_success(cmd, response)); |
| 1662 | |
| 1663 | cs->channel->openchannel_signed_cmd = NULL; |
| 1664 | } |
| 1665 | } |
| 1666 | |
| 1667 | static void check_utxo_block(struct bitcoind *bitcoind UNUSED, |
| 1668 | const struct bitcoin_tx_output *txout, |
no test coverage detected