Skip to content

Commit 6d09642

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 fe4a1aa commit 6d09642

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
@@ -967,6 +967,7 @@ impl OutboundPayments {
967967
F: Fn(SendAlongPathArgs) -> Result<(), APIError>,
968968
{
969969
let payment_id = PaymentId(entropy_source.get_secure_random_bytes());
970+
let payment_secret = PaymentSecret(entropy_source.get_secure_random_bytes());
970971

971972
let payment_hash = probing_cookie_from_id(&payment_id, probing_cookie_secret);
972973

@@ -978,7 +979,7 @@ impl OutboundPayments {
978979

979980
let route = Route { paths: vec![path], payment_params: None };
980981
let onion_session_privs = self.add_new_pending_payment(payment_hash,
981-
RecipientOnionFields::spontaneous_empty(), payment_id, None, &route, None, None,
982+
RecipientOnionFields::secret_only(payment_secret), payment_id, None, &route, None, None,
982983
entropy_source, best_block_height)?;
983984

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

0 commit comments

Comments
 (0)