lightningnetwork / lnd

Lightning Network Daemon ⚡️
MIT License
7.63k stars 2.07k forks source link

Learn feature bits of channel partner that does not have public channels #4265

Open PatrickZGW opened 4 years ago

PatrickZGW commented 4 years ago

Background

I have a channel with a node that does not have public channels. When I try to do a keysend to them, the failure message is Payment status: FAILED, reason: FAILURE_REASON_NO_ROUTE. Paying an invoice from that node works without issues however.

The reason for this seems to be that the route is calculated based on the public network graph. It does not take into account the fact that I have a channel with that node already and fails the payment.

Both nodes have accept-keysend enabled.

Your environment

Steps to reproduce

Open private channel with node that has no public channels. Try to send keysend payment.

Expected behaviour

The payment should go through.

Actual behaviour

Payment fails with FAILURE_REASON_NO_ROUTE

cfromknecht commented 4 years ago

@PatrickLemke in general when a node doesn't have a node_announcement (no public channels) we can't determine what sort of features it supports. when paying unadvertised nodes, you can set the dest_features with the features you want to assume the receiver supports.

in this case, keysend is dependent on TLV onions, which is feature bit 9. setting that in the rpc request will override what's in the graph (no feature bits at all).

the case here is slightly different, because you can more readily determine your own channel peer's support. perhaps the PR title should reflect that the situation can be improved for your own private channels, given that lnd does support keysends to private nodes?

PatrickZGW commented 4 years ago

Yes I think that's exactly right. There could be a way to gossip with all your channel partners even if you have no public channels and are therefore not "visible" to the public network.

PatrickZGW commented 4 years ago

Is this title better?

cfromknecht commented 4 years ago

@PatrickLemke yes that's perfect. in fact we already exchange feature bits on each connection with our peers via the Init message. from there it's just a matter of feeding these dynamically into the router so that it can use those as the inferred feature set.

remyers commented 3 years ago

I also hit this issue with private channels and keysend. The suggested change would be useful to remove gossip traffic for low-bandwidth (eg. radio connected) nodes using keysend. This change should be complementary with #3999 also.

xanoni commented 3 years ago

you can set the dest_features

How?