File tree Expand file tree Collapse file tree 1 file changed +6
-4
lines changed Expand file tree Collapse file tree 1 file changed +6
-4
lines changed Original file line number Diff line number Diff line change @@ -1382,13 +1382,12 @@ impl<SP: Deref> Channel<SP> where
13821382 L::Target: Logger
13831383 {
13841384 let phase = core::mem::replace(&mut self.phase, ChannelPhase::Undefined);
1385- if let ChannelPhase::UnfundedOutboundV1(chan) = phase {
1385+ let result = if let ChannelPhase::UnfundedOutboundV1(chan) = phase {
13861386 let logger = WithChannelContext::from(logger, &chan.context, None);
13871387 match chan.funding_signed(msg, best_block, signer_provider, &&logger) {
13881388 Ok((chan, monitor)) => {
13891389 self.phase = ChannelPhase::Funded(chan);
1390- let funded_chan = self.as_funded_mut().expect("Channel should be funded");
1391- Ok((funded_chan, monitor))
1390+ Ok(monitor)
13921391 },
13931392 Err((chan, e)) => {
13941393 self.phase = ChannelPhase::UnfundedOutboundV1(chan);
@@ -1398,7 +1397,10 @@ impl<SP: Deref> Channel<SP> where
13981397 } else {
13991398 self.phase = phase;
14001399 Err(ChannelError::NotFound("Failed to find corresponding channel".to_owned()))
1401- }
1400+ };
1401+
1402+ debug_assert!(!matches!(self.phase, ChannelPhase::Undefined));
1403+ result.map(|monitor| (self.as_funded_mut().expect("Channel should be funded"), monitor))
14021404 }
14031405}
14041406
You can’t perform that action at this time.
0 commit comments