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

Function valid_commitment_tx

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

2202/* FIXME: This should be a complete check, not just a sanity check.
2203 * Perhaps that means we need a cookie from the HSM? */
2204static bool valid_commitment_tx(struct channel *channel,
2205 const struct bitcoin_tx *tx)
2206{
2207 /* We've had past issues where all outputs are trimmed. */
2208 if (tx->wtx->num_outputs == 0) {
2209 channel_internal_error(channel,
2210 "channel_got_commitsig: zero output tx! %s",
2211 fmt_bitcoin_tx(tmpctx, tx));
2212 return false;
2213 }
2214 return true;
2215}
2216
2217static bool peer_save_commitsig_received(struct channel *channel, u64 commitnum,
2218 struct bitcoin_tx *tx,

Callers 1

Calls 2

fmt_bitcoin_txFunction · 0.85
channel_internal_errorFunction · 0.70

Tested by

no test coverage detected