MCPcopy Create free account
hub / github.com/ElementsProject/lightning / check_utxo_block

Function check_utxo_block

lightningd/dual_open_control.c:1667–1699  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1665}
1666
1667static void check_utxo_block(struct bitcoind *bitcoind UNUSED,
1668 const struct bitcoin_tx_output *txout,
1669 void *arg)
1670{
1671 struct channel_send *cs = arg;
1672 struct command *cmd = cs->channel->openchannel_signed_cmd;
1673 const struct wally_tx *wtx = cs->wtx;
1674
1675 /* note: if this tx has been included in a block *and spent*
1676 * then this will also fail... */
1677 if (!txout) {
1678 if (cmd) {
1679 was_pending(command_fail(cmd,
1680 FUNDING_BROADCAST_FAIL,
1681 "Error broadcasting funding "
1682 "tx: %s. Unsent tx discarded "
1683 "%s.",
1684 cs->err_msg,
1685 fmt_wally_tx(tmpctx, wtx)));
1686 cs->channel->openchannel_signed_cmd = NULL;
1687 }
1688
1689 log_unusual(cs->channel->log,
1690 "Error broadcasting funding "
1691 "tx: %s. Unsent tx discarded "
1692 "%s.",
1693 cs->err_msg,
1694 fmt_wally_tx(tmpctx, wtx));
1695 } else
1696 handle_tx_broadcast(cs);
1697
1698 tal_free(cs);
1699}
1700
1701static void sendfunding_done(struct bitcoind *bitcoind UNUSED,
1702 bool success, const char *msg,

Callers

nothing calls this directly

Calls 5

fmt_wally_txFunction · 0.85
tal_freeFunction · 0.85
was_pendingFunction · 0.70
command_failFunction · 0.70
handle_tx_broadcastFunction · 0.70

Tested by

no test coverage detected