channeld: Cleaner error messages

Since handling commit sig batches is coming for multiple locations now, add more explicity error handling so log messages are more useful.
This commit is contained in:
Dusty Daemon
2025-06-16 14:04:13 -04:00
committed by Rusty Russell
parent 7eb2add23c
commit 3841737d5c

View File

@@ -2270,6 +2270,12 @@ static struct commitsig_info *handle_peer_commit_sig_batch(struct peer *peer,
struct tlv_commitment_signed_tlvs *cs_tlv
= tlv_commitment_signed_tlvs_new(tmpctx);
status_debug("fromwire_commitment_signed(%p) primary", msg);
check_tx_abort(peer, msg, NULL);
type = fromwire_peektype(msg);
if (type != WIRE_COMMITMENT_SIGNED)
peer_failed_err(peer->pps, &peer->channel_id,
"Expected WIRE_COMMITMENT_SIGNED but got %s.",
peer_wire_name(type));
if (!fromwire_commitment_signed(tmpctx, msg,
&channel_id, &commit_sig.s, &raw_sigs,
&cs_tlv))