alexbosworth / ln-service

Node.js interface to LND
MIT License
319 stars 60 forks source link

probeForRoute and getRouteToDestination fail when outgoing_channel is set #156

Closed dannydeezy closed 2 years ago

dannydeezy commented 2 years ago

Using latest: "ln-service": "^53.16.1"

These both work when no outgoing_channel is provided:

await getRouteToDestination({ lnd, destination: <REDACTED>, tokens:100000}
await probeForRoute({ lnd, destination: <REDACTED>, tokens:100000}

But if I provide an outgoing_channel like this:

await getRouteToDestination({ lnd, destination: <REDACTED>, tokens:100000, outgoing_channel: <REDACTED>}
await probeForRoute({ lnd, destination: <REDACTED>, tokens:100000, outgoing_channel: <REDACTED>}

then they fail with:

/Users/deezy/lightning/fee-setter/node_modules/async/internal/onlyOnce.js:9
        if (fn === null) throw new Error("Callback was already called.");
                               ^

Error: Callback was already called.
    at /Users/deezy/lightning/fee-setter/node_modules/async/internal/onlyOnce.js:9:32
    at asyncAuto.amountMillitokens (/Users/deezy/lightning/fee-setter/node_modules/lightning/lnd_methods/info/get_route_to_destination.js:149:18)
    at runTask (/Users/deezy/lightning/fee-setter/node_modules/async/auto.js:293:13)
    at /Users/deezy/lightning/fee-setter/node_modules/async/auto.js:233:31
    at processQueue (/Users/deezy/lightning/fee-setter/node_modules/async/auto.js:243:13)
    at taskComplete (/Users/deezy/lightning/fee-setter/node_modules/async/auto.js:259:9)
    at /Users/deezy/lightning/fee-setter/node_modules/async/auto.js:286:17
    at /Users/deezy/lightning/fee-setter/node_modules/async/internal/onlyOnce.js:12:16
    at validate (/Users/deezy/lightning/fee-setter/node_modules/lightning/lnd_methods/info/get_route_to_destination.js:136:16)
    at runTask (/Users/deezy/lightning/fee-setter/node_modules/async/auto.js:295:13)
alexbosworth commented 2 years ago

How did you get the outgoing channel id exactly

dannydeezy commented 2 years ago

How did you get the outgoing channel id exactly

Ah you got it! I was using the channelId that looks like this: 809001964152684544, but I see now I should be using the id that looks like this: 735783x2026x0 (which is the id that bos uses). Thanks!