Skip to content

Commit 916e179

Browse files
committed
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 8203448 commit 916e179

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
@@ -2307,6 +2307,12 @@ static struct commitsig_info *handle_peer_commit_sig_batch(struct peer *peer,
23072307
struct tlv_commitment_signed_tlvs *cs_tlv
23082308
= tlv_commitment_signed_tlvs_new(tmpctx);
23092309
status_debug("fromwire_commitment_signed(%p) primary", msg);
2310+
check_tx_abort(peer, msg, NULL);
2311+
type = fromwire_peektype(msg);
2312+
if (type != WIRE_COMMITMENT_SIGNED)
2313+
peer_failed_err(peer->pps, &peer->channel_id,
2314+
"Expected WIRE_COMMITMENT_SIGNED but got %s.",
2315+
peer_wire_name(type));
23102316
if (!fromwire_commitment_signed(tmpctx, msg,
23112317
&channel_id, &commit_sig.s, &raw_sigs,
23122318
&cs_tlv))

0 commit comments

Comments
 (0)