Skip to content

Commit 28ecf25

Browse files
ddustinrustyrussell
authored andcommitted
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.
1 parent 7c5d56b commit 28ecf25

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

channeld/channeld.c

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2270,6 +2270,12 @@ static struct commitsig_info *handle_peer_commit_sig_batch(struct peer *peer,
22702270
struct tlv_commitment_signed_tlvs *cs_tlv
22712271
= tlv_commitment_signed_tlvs_new(tmpctx);
22722272
status_debug("fromwire_commitment_signed(%p) primary", msg);
2273+
check_tx_abort(peer, msg, NULL);
2274+
type = fromwire_peektype(msg);
2275+
if (type != WIRE_COMMITMENT_SIGNED)
2276+
peer_failed_err(peer->pps, &peer->channel_id,
2277+
"Expected WIRE_COMMITMENT_SIGNED but got %s.",
2278+
peer_wire_name(type));
22732279
if (!fromwire_commitment_signed(tmpctx, msg,
22742280
&channel_id, &commit_sig.s, &raw_sigs,
22752281
&cs_tlv))

0 commit comments

Comments
 (0)