Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: add routing hints for private nodes in LND #1186

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

im-adithya
Copy link
Member

Fixes #1171

Goes through all the private channels, if there is a routing policy, it adds that channel as a hint, skips if it doesn't OR if the peer is already processed i.e. added as a hint.

@im-adithya im-adithya requested a review from rolznz March 13, 2025 18:12
@@ -492,6 +503,60 @@ func (svc *LNDService) MakeInvoice(ctx context.Context, amount int64, descriptio
return transaction, nil
}

func (svc *LNDService) getRoutingHints(ctx context.Context) (hints []*lnrpc.RouteHint, err error) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Did you take inspiration from anywhere for this code? I think there are quite a few issues here.

Can you please check the LND codebase and some other lightning wallets (e.g. https://github1s.com/ZeusLN/zeus/blob/HEAD/lndmobile/index.ts#L632-L633)

I think there's no limit right now, right? we need to limit it to 3 (the "best" options based on incoming liquidity and fees)

Can you also check if we have 1 peer the route hint is exactly the same as is when not using this code. We need to make very sure we don't break this code otherwise no-one with private channels will be able to receive.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not sure the above code I linked is used. I've also asked Zeus if they can give us any recommendations.

continue
}

remotePolicy := chanInfo.Node2Policy
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Node2 is not always the counterparty is it?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Bug: LND only recommends one routing hint to receive payments (+ has issues receiving on ACINQ channel)
2 participants