Skip to content

Commit bcaeabd

Browse files
committed
f if let
1 parent 3cf0f27 commit bcaeabd

File tree

1 file changed

+9
-12
lines changed

1 file changed

+9
-12
lines changed

lightning/src/ln/channelmanager.rs

Lines changed: 9 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -3840,18 +3840,15 @@ impl<Signer: Sign, M: Deref, T: Deref, K: Deref, F: Deref, L: Deref> ChannelMana
38403840
break;
38413841
}
38423842
expected_amt_msat = Some(htlc.total_msat);
3843-
match &htlc.onion_payload {
3844-
OnionPayload::Spontaneous(_) => {
3845-
// We don't currently support MPP for spontaneous payments, so just check
3846-
// that there's one payment here and move on.
3847-
if sources.len() != 1 {
3848-
log_error!(self.logger, "Somehow ended up with an MPP spontaneous payment - this should not be reachable!");
3849-
debug_assert!(false);
3850-
valid_mpp = false;
3851-
break;
3852-
}
3853-
},
3854-
OnionPayload::Invoice {.. } => {},
3843+
if let OnionPayload::Spontaneous(_) = &htlc.onion_payload {
3844+
// We don't currently support MPP for spontaneous payments, so just check
3845+
// that there's one payment here and move on.
3846+
if sources.len() != 1 {
3847+
log_error!(self.logger, "Somehow ended up with an MPP spontaneous payment - this should not be reachable!");
3848+
debug_assert!(false);
3849+
valid_mpp = false;
3850+
break;
3851+
}
38553852
}
38563853

38573854
claimable_amt_msat += htlc.value;

0 commit comments

Comments
 (0)