From 3841737d5c236ca052c9aaf6d333035bcfafdcbf Mon Sep 17 00:00:00 2001 From: Dusty Daemon Date: Mon, 16 Jun 2025 14:04:13 -0400 Subject: [PATCH] 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. --- channeld/channeld.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/channeld/channeld.c b/channeld/channeld.c index fde5e3821..efbf48003 100644 --- a/channeld/channeld.c +++ b/channeld/channeld.c @@ -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))