Skip to content

Commit b14a4bd

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 e5cd5c8 commit b14a4bd

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
@@ -7267,6 +7267,10 @@ where
72677267
.pending_splice
72687268
.as_mut()
72697269
.expect("reset_pending_splice_state requires pending_splice");
7270+
debug_assert!(
7271+
pending_splice.funding_negotiation.is_some(),
7272+
"reset_pending_splice_state requires an active funding negotiation"
7273+
);
72707274
let is_initiator = pending_splice
72717275
.funding_negotiation
72727276
.take()
@@ -7313,6 +7317,10 @@ where
73137317
}
73147318

73157319
let pending_splice = self.pending_splice.as_ref()?;
7320+
debug_assert!(
7321+
pending_splice.funding_negotiation.is_some(),
7322+
"maybe_splice_funding_failed requires an active funding negotiation"
7323+
);
73167324
let is_initiator = pending_splice
73177325
.funding_negotiation
73187326
.as_ref()

0 commit comments

Comments
 (0)