-
Notifications
You must be signed in to change notification settings - Fork 132
AddInvoice
correctly handles existing route hints
#1627
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
base: main
Are you sure you want to change the base?
Conversation
Pull Request Test Coverage Report for Build 15973315571Details
💛 - Coveralls |
for _, hint := range hints { | ||
for _, h := range hint.HopHints { | ||
scid := h.ChanId | ||
buyQuote, ok := buyQuotes[rfqmsg.SerialisedScid(scid)] | ||
if !ok { | ||
continue | ||
} | ||
|
||
quoteSpecifier := buyQuote.Request.AssetSpecifier | ||
|
||
if quoteSpecifier.String() == specifier.String() { | ||
return &buyQuote | ||
} | ||
} | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should we check that there are no other quotes here? So exhaustively check: find the quote, but then keep looking and error if we find another matching quote.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's not really crucial to not have competing quotes here, as we're just picking one to create the invoice over.
For the case where the user wants to provide multiple quotes for a multi-rfq receive we're going to introduce the RPC level rfq_ids
field, which would also eliminate the need to manually create a []RouteHints
argument
Description
After merging #1359 we changed some of the logic around acquiring quotes in
taprpc.AddInvoice
. A special edge case where the user has already negotiated a quote and included it in thelnrpc.Invoice
route hints would lead into a crash as a variable would remain unset.Closes #1622