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
1382
1382
L::Target: Logger
1383
1383
{
1384
1384
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 {
1386
1386
let logger = WithChannelContext::from(logger, &chan.context, None);
1387
1387
match chan.funding_signed(msg, best_block, signer_provider, &&logger) {
1388
1388
Ok((chan, monitor)) => {
1389
1389
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)
1392
1391
},
1393
1392
Err((chan, e)) => {
1394
1393
self.phase = ChannelPhase::UnfundedOutboundV1(chan);
@@ -1398,7 +1397,10 @@ impl<SP: Deref> Channel<SP> where
1398
1397
} else {
1399
1398
self.phase = phase;
1400
1399
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))
1402
1404
}
1403
1405
}
1404
1406
You can’t perform that action at this time.
0 commit comments