Skip to content

Commit 758679a

Browse files
committed
Set payment_secret when sending probes
Previously, we'd leave the payment secret field empty while sending probes, which resulted in having them rejected with `(PERM|invalid_onion_payload)` by Eclair nodes. In order to mitigate the issue, we just set a random payment secret.
1 parent 1f32ba4 commit 758679a

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

lightning/src/ln/outbound_payment.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1103,6 +1103,7 @@ impl OutboundPayments {
11031103
F: Fn(SendAlongPathArgs) -> Result<(), APIError>,
11041104
{
11051105
let payment_id = PaymentId(entropy_source.get_secure_random_bytes());
1106+
let payment_secret = PaymentSecret(entropy_source.get_secure_random_bytes());
11061107

11071108
let payment_hash = probing_cookie_from_id(&payment_id, probing_cookie_secret);
11081109

@@ -1114,7 +1115,7 @@ impl OutboundPayments {
11141115

11151116
let route = Route { paths: vec![path], route_params: None };
11161117
let onion_session_privs = self.add_new_pending_payment(payment_hash,
1117-
RecipientOnionFields::spontaneous_empty(), payment_id, None, &route, None, None,
1118+
RecipientOnionFields::secret_only(payment_secret), payment_id, None, &route, None, None,
11181119
entropy_source, best_block_height)?;
11191120

11201121
match self.pay_route_internal(&route, payment_hash, RecipientOnionFields::spontaneous_empty(),

0 commit comments

Comments
 (0)