| 1501 | } |
| 1502 | |
| 1503 | static void sendfunding_done(struct bitcoind *bitcoind UNUSED, |
| 1504 | bool success, const char *msg, |
| 1505 | struct channel_send *cs) |
| 1506 | { |
| 1507 | struct lightningd *ld = cs->channel->peer->ld; |
| 1508 | struct channel *channel = cs->channel; |
| 1509 | struct command *cmd = channel->openchannel_signed_cmd; |
| 1510 | |
| 1511 | if (!cmd && channel->opener == LOCAL) |
| 1512 | log_unusual(channel->log, |
| 1513 | "No outstanding command for channel %s," |
| 1514 | " funding sent was success? %d", |
| 1515 | type_to_string(tmpctx, struct channel_id, |
| 1516 | &channel->cid), |
| 1517 | success); |
| 1518 | |
| 1519 | if (success) { |
| 1520 | handle_tx_broadcast(cs); |
| 1521 | tal_free(cs); |
| 1522 | } else { |
| 1523 | /* If the tx was mined into a block, it's possible |
| 1524 | * that the broadcast would fail. Verify that's not |
| 1525 | * the case here. */ |
| 1526 | cs->err_msg = tal_strdup(cs, msg); |
| 1527 | bitcoind_getutxout(ld->topology->bitcoind, |
| 1528 | &channel->funding, |
| 1529 | check_utxo_block, |
| 1530 | cs); |
| 1531 | } |
| 1532 | } |
| 1533 | |
| 1534 | |
| 1535 | static void send_funding_tx(struct channel *channel, |
nothing calls this directly
no test coverage detected