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

Function check_utxo_block

lightningd/dual_open_control.c:1467–1501  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1465}
1466
1467static void check_utxo_block(struct bitcoind *bitcoind UNUSED,
1468 const struct bitcoin_tx_output *txout,
1469 void *arg)
1470{
1471 struct channel_send *cs = arg;
1472 struct command *cmd = cs->channel->openchannel_signed_cmd;
1473 const struct wally_tx *wtx = cs->wtx;
1474
1475 /* note: if this tx has been included in a block *and spent*
1476 * then this will also fail... */
1477 if (!txout) {
1478 if (cmd) {
1479 was_pending(command_fail(cmd,
1480 FUNDING_BROADCAST_FAIL,
1481 "Error broadcasting funding "
1482 "tx: %s. Unsent tx discarded "
1483 "%s.",
1484 cs->err_msg,
1485 type_to_string(tmpctx,
1486 struct wally_tx,
1487 wtx)));
1488 cs->channel->openchannel_signed_cmd = NULL;
1489 }
1490
1491 log_unusual(cs->channel->log,
1492 "Error broadcasting funding "
1493 "tx: %s. Unsent tx discarded "
1494 "%s.",
1495 cs->err_msg,
1496 type_to_string(tmpctx, struct wally_tx, wtx));
1497 } else
1498 handle_tx_broadcast(cs);
1499
1500 tal_free(cs);
1501}
1502
1503static void sendfunding_done(struct bitcoind *bitcoind UNUSED,
1504 bool success, const char *msg,

Callers

nothing calls this directly

Calls 5

was_pendingFunction · 0.85
handle_tx_broadcastFunction · 0.85
tal_freeFunction · 0.85
command_failFunction · 0.70
type_to_stringClass · 0.50

Tested by

no test coverage detected