Lnd: Private invoices are not marked as private on lookup

Created on 12 Nov 2018  路  7Comments  路  Source: lightningnetwork/lnd

Background

Looking up invoices that were created as "private" invoices does not reflect their private status as created.

Your environment

  • lnd - commit d4b042dc1946ece8b60d538ade8e912f035612fe
  • MacOS Mojave
  • btcd - commit 67e573d211ace594f1366b4ce9d39726c4b19bd0

Steps to reproduce

  • GRPC addInvoice - private set to `true
  • GRPC lookupInvoice - invoice id

Expected behaviour

Response should indicate that the invoice is a "private" invoice

Actual behaviour

Response indicates private is false

P3 bug database payments

Most helpful comment

I could take a look at this.

All 7 comments

I could take a look at this.

We use the exact same proto/struct for both the response and request. However, atm, we don't also include this value when printing out the response. This should definitely be made consistent, I've had a few other people bring this up in the past.

Atm we don't store the private setting in the database. Is there a reason for not doing this?
My experimental code adds this setting to all new invoices before they are stored in the database. Because of this, I'm forced to do some nasty tests to keep backward comparability when reading old invoices from the db, which would be nice to get rid of. I'm not sure how I should precede with this one.

--private is only indicating that private __channels__ should be used as hop hints. There's no such thing as a private invoice I think.

With current lnd behavior if we want to make the lookup reflect the initial setting, we can just check if there are any routing hints in the invoice, meaning it was created with the --private option.

More clarity is needed on how exactly --private is supposed to behave.

If I have a node and it has only private channels, my invoice MUST use routing hints and lnd DOES append routing hints regardless of whether I use --private.

If I have a node and it only has public channels, my invoice doesn't need routing hints and lnd DOES NOT append routing hints regardless of whether I use --private.

If my node has both public and private channels, what should I expect the behavior of --private to be?

Testing a node with one public and one private channel to the same node, and lnd DOES append routing hints regardless of whether I use --private.

Testing a node with one public and one private channel to different nodes, and lnd DOES append routing hints regardless of whether I use --private.

The public and private channels are configured identically except for the --private setting. Given the option between public and private channels, lnd chooses the private channel + route hint whether or not --private is used.

"version": "0.5.1-beta commit=v0.5.1-beta-rc2-4-gd6d833c2421f4a65c6db5190d1dcd73f549fbf70"

The public and private channels are configured identically except for the --private setting. Given the option between public and private channels, lnd chooses the private channel + route hint whether or not --private is used.

This is because invoices created through the CLI will set private=true regardless of whether or not you specified it. If you wish to not include any, you have to do so explicitly with private=false.

Fixed by #2222.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

alexbosworth picture alexbosworth  路  3Comments

whizz picture whizz  路  3Comments

hxsquid picture hxsquid  路  3Comments

BitBargain picture BitBargain  路  3Comments

stevenroose picture stevenroose  路  3Comments