Global Feed Post Login
Replying to Avatar sommerfeld

I did some digging (when I should have been working on my fiat job). Here are my findings:

TLDR: it shouldn't work for nodes with only private channels since ligess is not passing the parameter `private` to `lnd`'s `AddInvoice` RPC method:

Here are the relevant code parts:

1 - `ligess` calls una's `createInvoice`

https://github.com/Dolu89/ligess/blob/d8c71626a403a5d40f6f88b134506d7776a34d3a/router.js#L47-L53

2 - una translates and passes these parameters:

https://github.com/blc-org/una/blob/c4ae26440081b29f8a0f3b950a1be948dc9cb872/bindings/una-js/index.d.ts#L22-L32

3 - una calls the `lnd`'s `AddInvoice` using REST

https://github.com/blc-org/una/blob/c4ae26440081b29f8a0f3b950a1be948dc9cb872/core/src/backends/lnd/rest/node.rs#L66

4 - That method has these docs (check the field `private`)

https://lightning.engineering/api-docs/api/lnd/lightning/add-invoice

5 - On `lnd`'s code base, that field has no explicit default and since it's in rust, the defaults to false

https://github.com/lightningnetwork/lnd/blob/ea0eb2ce72dcd0be9d444083dacb6ca42944e70e/lnrpc/invoicesrpc/addinvoice.go#L125

In order to fix this, one would need to patch botch ligess and una to pass the `private=true` parameter.

Avatar
Lurking Cat 2y ago

Thank you #[1] , for your precious time investigation 🙏

#[0]

Reply to this note

Please Login to reply.

Discussion

Avatar
Lurking Cat 2y ago

Thank you for zap sir #[2] 🙏

Thread collapsed