| 1435 | }; |
| 1436 | |
| 1437 | static void handle_tx_broadcast(struct channel_send *cs) |
| 1438 | { |
| 1439 | struct lightningd *ld = cs->channel->peer->ld; |
| 1440 | const struct wally_tx *wtx = cs->wtx; |
| 1441 | struct channel *channel = cs->channel; |
| 1442 | struct command *cmd = channel->openchannel_signed_cmd; |
| 1443 | struct json_stream *response; |
| 1444 | struct bitcoin_txid txid; |
| 1445 | struct amount_sat unused; |
| 1446 | int num_utxos; |
| 1447 | |
| 1448 | /* This might have spent UTXOs from our wallet */ |
| 1449 | num_utxos = wallet_extract_owned_outputs(ld->wallet, |
| 1450 | wtx, NULL, |
| 1451 | &unused); |
| 1452 | if (num_utxos) |
| 1453 | wallet_transaction_add(ld->wallet, wtx, 0, 0); |
| 1454 | |
| 1455 | if (cmd) { |
| 1456 | response = json_stream_success(cmd); |
| 1457 | wally_txid(wtx, &txid); |
| 1458 | json_add_hex_talarr(response, "tx", linearize_wtx(tmpctx, wtx)); |
| 1459 | json_add_txid(response, "txid", &txid); |
| 1460 | json_add_channel_id(response, "channel_id", &channel->cid); |
| 1461 | was_pending(command_success(cmd, response)); |
| 1462 | |
| 1463 | cs->channel->openchannel_signed_cmd = NULL; |
| 1464 | } |
| 1465 | } |
| 1466 | |
| 1467 | static void check_utxo_block(struct bitcoind *bitcoind UNUSED, |
| 1468 | const struct bitcoin_tx_output *txout, |
no test coverage detected