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

Function valid_commitment_tx

lightningd/peer_htlcs.c:2134–2145  ·  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

2132/* FIXME: This should be a complete check, not just a sanity check.
2133 * Perhaps that means we need a cookie from the HSM? */
2134static bool valid_commitment_tx(struct channel *channel,
2135 const struct bitcoin_tx *tx)
2136{
2137 /* We've had past issues where all outputs are trimmed. */
2138 if (tx->wtx->num_outputs == 0) {
2139 channel_internal_error(channel,
2140 "channel_got_commitsig: zero output tx! %s",
2141 fmt_bitcoin_tx(tmpctx, tx));
2142 return false;
2143 }
2144 return true;
2145}
2146
2147static bool peer_save_commitsig_received(struct channel *channel, u64 commitnum,
2148 struct bitcoin_tx *tx,

Callers 1

Calls 2

fmt_bitcoin_txFunction · 0.85
channel_internal_errorFunction · 0.70

Tested by

no test coverage detected