@@ -1259,9 +1259,9 @@ impl<SP: Deref> Channel<SP> where
1259
1259
ChannelPhase::Funded(_) => { debug_assert!(false); None }
1260
1260
#[cfg(splicing)]
1261
1261
ChannelPhase::Funded(chan) => {
1262
- chan.pending_splice.as_mut().map (|splice|
1262
+ chan.pending_splice.as_mut().and_then (|splice|
1263
1263
splice.refunding_scope.as_mut().map(|refunding_scope| &mut refunding_scope.pending_unfunded_context)
1264
- ).flatten()
1264
+ )
1265
1265
}
1266
1266
ChannelPhase::UnfundedOutboundV1(chan) => Some(&mut chan.unfunded_context),
1267
1267
ChannelPhase::UnfundedInboundV1(chan) => Some(&mut chan.unfunded_context),
@@ -2431,66 +2431,66 @@ impl<SP: Deref> InitialRemoteCommitmentReceiver<SP> for FundedChannel<SP> where
2431
2431
impl<SP: Deref> FundingTxConstructorV2<SP> for FundedChannel<SP> where SP::Target: SignerProvider {
2432
2432
#[inline]
2433
2433
fn pending_funding(&self) -> Result<&FundingScope, &'static str> {
2434
- self.pending_splice.as_ref().map (|splice|
2434
+ self.pending_splice.as_ref().and_then (|splice|
2435
2435
splice.refunding_scope.as_ref().map(|refunding| &refunding.pending_funding)
2436
- ).flatten(). ok_or("Not re-funding")
2436
+ ).ok_or("Not re-funding")
2437
2437
}
2438
2438
2439
2439
#[inline]
2440
2440
fn pending_funding_mut(&mut self) -> Result<&mut FundingScope, &'static str> {
2441
- self.pending_splice.as_mut().map (|splice|
2441
+ self.pending_splice.as_mut().and_then (|splice|
2442
2442
splice.refunding_scope.as_mut().map(|refunding| &mut refunding.pending_funding)
2443
- ).flatten(). ok_or("Not re-funding")
2443
+ ).ok_or("Not re-funding")
2444
2444
}
2445
2445
2446
2446
#[inline]
2447
2447
fn pending_funding_and_context_mut(&mut self) -> Result<(&FundingScope, &mut ChannelContext<SP>), &'static str> {
2448
2448
let context_mut = &mut self.context;
2449
- self.pending_splice.as_ref().map (|splice|
2449
+ self.pending_splice.as_ref().and_then (|splice|
2450
2450
splice.refunding_scope.as_ref().map(|refunding| (&refunding.pending_funding, context_mut))
2451
- ).flatten(). ok_or("Not re-funding")
2451
+ ).ok_or("Not re-funding")
2452
2452
}
2453
2453
2454
2454
#[inline]
2455
2455
fn dual_funding_context(&self) -> Result<&DualFundingChannelContext, &'static str> {
2456
- self.pending_splice.as_ref().map (|splice|
2456
+ self.pending_splice.as_ref().and_then (|splice|
2457
2457
splice.refunding_scope.as_ref().map(|refunding| &refunding.pending_dual_funding_context)
2458
- ).flatten(). ok_or("Not re-funding")
2458
+ ).ok_or("Not re-funding")
2459
2459
}
2460
2460
2461
2461
#[inline]
2462
2462
fn dual_funding_context_mut(&mut self) -> Result<&mut DualFundingChannelContext, &'static str> {
2463
- self.pending_splice.as_mut().map (|splice|
2463
+ self.pending_splice.as_mut().and_then (|splice|
2464
2464
splice.refunding_scope.as_mut().map(|refunding| &mut refunding.pending_dual_funding_context)
2465
- ).flatten(). ok_or("Not re-funding")
2465
+ ).ok_or("Not re-funding")
2466
2466
}
2467
2467
2468
2468
#[inline]
2469
2469
fn unfunded_context(&self) -> Result<&UnfundedChannelContext, &'static str> {
2470
- self.pending_splice.as_ref().map (|splice|
2470
+ self.pending_splice.as_ref().and_then (|splice|
2471
2471
splice.refunding_scope.as_ref().map(|refunding| &refunding.pending_unfunded_context)
2472
- ).flatten(). ok_or("Not re-funding")
2472
+ ).ok_or("Not re-funding")
2473
2473
}
2474
2474
2475
2475
#[inline]
2476
2476
fn interactive_tx_constructor(&self) -> Result<Option<&InteractiveTxConstructor>, &'static str> {
2477
- self.pending_splice.as_ref().map (|splice|
2477
+ self.pending_splice.as_ref().and_then (|splice|
2478
2478
splice.refunding_scope.as_ref().map(|refunding| refunding.pending_interactive_tx_constructor.as_ref())
2479
- ).flatten(). ok_or("Not re-funding")
2479
+ ).ok_or("Not re-funding")
2480
2480
}
2481
2481
2482
2482
#[inline]
2483
2483
fn interactive_tx_constructor_mut(&mut self) -> Result<&mut Option<InteractiveTxConstructor>, &'static str> {
2484
- self.pending_splice.as_mut().map (|splice|
2484
+ self.pending_splice.as_mut().and_then (|splice|
2485
2485
splice.refunding_scope.as_mut().map(|refunding| &mut refunding.pending_interactive_tx_constructor)
2486
- ).flatten(). ok_or("Not re-funding")
2486
+ ).ok_or("Not re-funding")
2487
2487
}
2488
2488
2489
2489
#[inline]
2490
2490
fn interactive_tx_signing_session_mut(&mut self) -> Result<&mut Option<InteractiveTxSigningSession>, &'static str> {
2491
- self.pending_splice.as_mut().map (|splice|
2491
+ self.pending_splice.as_mut().and_then (|splice|
2492
2492
splice.refunding_scope.as_mut().map(|refunding| &mut refunding.pending_interactive_tx_signing_session)
2493
- ).flatten(). ok_or("Not re-funding")
2493
+ ).ok_or("Not re-funding")
2494
2494
}
2495
2495
}
2496
2496
0 commit comments