Skip to content

Commit f3cd992

Browse files
committed
f - debug_assert
1 parent 40c8c67 commit f3cd992

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

lightning/src/ln/channel.rs

+5-2
Original file line numberDiff line numberDiff line change
@@ -1425,7 +1425,7 @@ impl<SP: Deref> Channel<SP> where
14251425
L::Target: Logger
14261426
{
14271427
let phase = core::mem::replace(&mut self.phase, ChannelPhase::Undefined);
1428-
if let ChannelPhase::UnfundedV2(chan) = phase {
1428+
let result = if let ChannelPhase::UnfundedV2(chan) = phase {
14291429
let logger = WithChannelContext::from(logger, &chan.context, None);
14301430
match chan.funding_tx_constructed(signing_session, &&logger) {
14311431
Ok((chan, commitment_signed, event)) => {
@@ -1440,7 +1440,10 @@ impl<SP: Deref> Channel<SP> where
14401440
} else {
14411441
self.phase = phase;
14421442
Err(ChannelError::Warn("Got a tx_complete message with no interactive transaction construction expected or in-progress".to_owned()))
1443-
}
1443+
};
1444+
1445+
debug_assert!(!matches!(self.phase, ChannelPhase::Undefined));
1446+
result
14441447
}
14451448
}
14461449

0 commit comments

Comments
 (0)