Skip to content

Commit d5d3af0

Browse files
committed
Allow sending MPP keysend
This means allowing a user to send an MPP without a payment secret if it's a keysend payment.
1 parent 3b8bf93 commit d5d3af0

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

lightning/src/ln/channelmanager.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8351,7 +8351,7 @@ mod tests {
83518351

83528352
match nodes[0].node.send_payment(&route, payment_hash, &None, PaymentId(payment_hash.0)).unwrap_err() {
83538353
PaymentSendFailure::ParameterError(APIError::APIMisuseError { ref err }) => {
8354-
assert!(regex::Regex::new(r"Payment secret is required for multi-path payments").unwrap().is_match(err))
8354+
assert!(regex::Regex::new(r"Payment secret is required for non-keysend multi-path payments").unwrap().is_match(err))
83558355
},
83568356
_ => panic!("unexpected error")
83578357
}

lightning/src/ln/outbound_payment.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -892,8 +892,8 @@ impl OutboundPayments {
892892
if route.paths.len() < 1 {
893893
return Err(PaymentSendFailure::ParameterError(APIError::InvalidRoute{err: "There must be at least one path to send over".to_owned()}));
894894
}
895-
if payment_secret.is_none() && route.paths.len() > 1 {
896-
return Err(PaymentSendFailure::ParameterError(APIError::APIMisuseError{err: "Payment secret is required for multi-path payments".to_owned()}));
895+
if payment_secret.is_none() && route.paths.len() > 1 && keysend_preimage.is_none() {
896+
return Err(PaymentSendFailure::ParameterError(APIError::APIMisuseError{err: "Payment secret is required for non-keysend multi-path payments".to_owned()}));
897897
}
898898
let mut total_value = 0;
899899
let our_node_id = node_signer.get_node_id(Recipient::Node).unwrap(); // TODO no unwrap

0 commit comments

Comments
 (0)