Skip to content

Commit 1f27db0

Browse files
jkczyzclaude
andcommitted
f - Add debug_asserts for funding_negotiation invariant
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1 parent 58e7831 commit 1f27db0

1 file changed

Lines changed: 8 additions & 0 deletions

File tree

lightning/src/ln/channel.rs

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7250,6 +7250,10 @@ where
72507250
.pending_splice
72517251
.as_mut()
72527252
.expect("reset_pending_splice_state requires pending_splice");
7253+
debug_assert!(
7254+
pending_splice.funding_negotiation.is_some(),
7255+
"reset_pending_splice_state requires an active funding negotiation"
7256+
);
72537257
let is_initiator = pending_splice
72547258
.funding_negotiation
72557259
.take()
@@ -7296,6 +7300,10 @@ where
72967300
}
72977301

72987302
let pending_splice = self.pending_splice.as_ref()?;
7303+
debug_assert!(
7304+
pending_splice.funding_negotiation.is_some(),
7305+
"maybe_splice_funding_failed requires an active funding negotiation"
7306+
);
72997307
let is_initiator = pending_splice
73007308
.funding_negotiation
73017309
.as_ref()

0 commit comments

Comments
 (0)