Skip to content

Commit e19fe1e

Browse files
committed
f simplify conditionals
1 parent 5001e44 commit e19fe1e

File tree

1 file changed

+4
-5
lines changed

1 file changed

+4
-5
lines changed

lightning/src/ln/channelmanager.rs

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6535,13 +6535,12 @@ where
65356535
// prev_hop.counterparty_node_id is always available for payments received after
65366536
// LDK 0.0.123, but for those received on 0.0.123 and claimed later, we need to
65376537
// look up the counterparty in the `action_opt`, if possible.
6538-
if let Some(action) = &action_opt {
6538+
action_opt.as_ref().and_then(|action|
65396539
if let MonitorUpdateCompletionAction::PaymentClaimed { pending_mpp_claim, .. } = action {
6540-
if let Some((node_id, _, _, _)) = pending_mpp_claim {
6541-
Some(*node_id)
6542-
} else { None }
6540+
pending_mpp_claim.as_ref().map(|(node_id, _, _, _)| *node_id)
65436541
} else { None }
6544-
} else { None });
6542+
)
6543+
);
65456544
if let Some(counterparty_node_id) = counterparty_node_id {
65466545
// TODO: Avoid always blocking the world for the write lock here.
65476546
let mut per_peer_state = self.per_peer_state.write().unwrap();

0 commit comments

Comments
 (0)