Skip to content
This repository has been archived by the owner on Nov 17, 2023. It is now read-only.

Commit

Permalink
fix(lnd): selecting correct htlc from probe attempt
Browse files Browse the repository at this point in the history
  • Loading branch information
mrfelton committed Aug 11, 2020
1 parent bb27f8d commit 3edd322
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion services/grpc/router.methods.js
Original file line number Diff line number Diff line change
Expand Up @@ -129,8 +129,12 @@ async function probePaymentV2(payload) {
}

grpcLog.info('PROBE SUCCESS: %o', data)

// Prior to lnd v0.10.0 sendPayment would return a single route under the `route` key.
route = data.route || data.htlcs[0].route
route =
data.route ||
data.htlcs.find(a => a.failure.code === 'INCORRECT_OR_UNKNOWN_PAYMENT_DETAILS').route

// FIXME: For some reason the customRecords key is corrupt in the grpc response object.
// For now, assume that if a custom_record key is set that it is a keysend record and fix it accordingly.
route.hops = route.hops.map(hop => {
Expand Down

0 comments on commit 3edd322

Please sign in to comment.