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

Function valid_commitment_tx

lightningd/peer_htlcs.c:1889–1900  ·  view source on GitHub ↗

FIXME: This should be a complete check, not just a sanity check. * Perhaps that means we need a cookie from the HSM? */

Source from the content-addressed store, hash-verified

1887/* FIXME: This should be a complete check, not just a sanity check.
1888 * Perhaps that means we need a cookie from the HSM? */
1889static bool valid_commitment_tx(struct channel *channel,
1890 const struct bitcoin_tx *tx)
1891{
1892 /* We've had past issues where all outputs are trimmed. */
1893 if (tx->wtx->num_outputs == 0) {
1894 channel_internal_error(channel,
1895 "channel_got_commitsig: zero output tx! %s",
1896 type_to_string(tmpctx, struct bitcoin_tx, tx));
1897 return false;
1898 }
1899 return true;
1900}
1901
1902static bool peer_save_commitsig_received(struct channel *channel, u64 commitnum,
1903 struct bitcoin_tx *tx,

Callers 1

Calls 2

channel_internal_errorFunction · 0.70
type_to_stringClass · 0.50

Tested by

no test coverage detected