joule-labs / joule-extension

Lightning payments extension for Chrome

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Unknown Node in Transaction Tab

githorray opened this issue · comments

Description of the Issue

When I pay an invoice, the node info I am paying to is shown as expected

However the settled transaction in the transactions tab shows the node paid as "Unknown Node".

The details also say:

"No route info available

This payment may be too old, and not have stored routing data"

All the previous transactions now show the same "Unknown Node".

It may have started after moving to lnd 0.10

Description of Your Setup

Joule 0.5.2
Firefox 76.0.1
Ubuntu 20.04
lnd version 0.10.99-beta commit=clock/v1.0.0-7-gbdc0d875bc6c3bc0a41bba8dafecf98c151bb19a

commented

Also experiencing this issue with LND 0.12.1-beta. I think I've managed to pinpoint the faulty block of code.
The problem boils down to LND not including the "path" parameter anymore. Recipient's pubkey is hidden within the "htlcs" field instead.

const paymentNodeIds: string[] = paymentsRes.payments
.map(payment => (payment.path.length ? payment.path[payment.path.length - 1] : ''))
.filter(id => !!id)
.filter((id, idx, ids) => ids.indexOf(id) === idx);
const paymentNodes: Yielded<typeof nodeLib.getNodeInfo>[] = yield all(
paymentNodeIds.map(id => call(safeGetNodeInfo, nodeLib, id)),
);
const payments = paymentsRes.payments
.map(p => {
// Handle payments that may be missing a path
if (!p.path.length) {
return {
...p,
to: UNKNOWN_NODE,
};
}
const nodeResponse = paymentNodes.find(
n => p.path[p.path.length - 1] === n.node.pub_key,
);
return {
...p,
to: (nodeResponse as any).node,
};
})

The bug seems trivial to fix, but it's my first time looking at Joule's source code and without an example of an older API response I can't make out what all of the ids in lines 76 and 77 are supposed to mean. If anyone with an older LND version is willing to provide a sample node response, that would be greatly appreciated.

Also, here's the API response that my node sends back: https://api.lightning.community/?javascript#lnrpc-payment