Skip to content

Commit a04705e

Browse files
committed
f simplify conditionals
1 parent 976dc6a commit a04705e

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
@@ -6483,13 +6483,12 @@ where
64836483
// prev_hop.counterparty_node_id is always available for payments received after
64846484
// LDK 0.0.123, but for those received on 0.0.123 and claimed later, we need to
64856485
// look up the counterparty in the `action_opt`, if possible.
6486-
if let Some(action) = &action_opt {
6486+
action_opt.as_ref().and_then(|action|
64876487
if let MonitorUpdateCompletionAction::PaymentClaimed { pending_mpp_claim, .. } = action {
6488-
if let Some((node_id, _, _, _)) = pending_mpp_claim {
6489-
Some(*node_id)
6490-
} else { None }
6488+
pending_mpp_claim.as_ref().map(|(node_id, _, _, _)| *node_id)
64916489
} else { None }
6492-
} else { None });
6490+
)
6491+
);
64936492
if let Some(counterparty_node_id) = counterparty_node_id {
64946493
// TODO: Avoid always blocking the world for the write lock here.
64956494
let mut per_peer_state = self.per_peer_state.write().unwrap();

0 commit comments

Comments
 (0)