mirror of
https://github.com/lightningnetwork/lnd.git
synced 2025-02-22 06:21:40 +01:00
invoicesrpc: expose selectHopHints
selectHopHints is the function which constructs hophints otherwise found in an invoice created with the private flag. In this commit, we expose that functionality a little more to workaround needing to create an invoice to retrieve routing hints. Of course, this is not a perfect solution as the functionality is exposed exclusively to go users.
This commit is contained in:
parent
f901d450a5
commit
e4891a98fd
1 changed files with 3 additions and 3 deletions
|
@ -391,7 +391,7 @@ func AddInvoice(ctx context.Context, cfg *AddInvoiceConfig,
|
|||
// We'll restrict the number of individual route hints
|
||||
// to 20 to avoid creating overly large invoices.
|
||||
numMaxHophints := 20 - len(forcedHints)
|
||||
hopHints := selectHopHints(
|
||||
hopHints := SelectHopHints(
|
||||
amtMSat, cfg, filteredChannels, numMaxHophints,
|
||||
)
|
||||
|
||||
|
@ -553,12 +553,12 @@ func addHopHint(hopHints *[]func(*zpay32.Invoice),
|
|||
)
|
||||
}
|
||||
|
||||
// selectHopHints will select up to numMaxHophints from the set of passed open
|
||||
// SelectHopHints will select up to numMaxHophints from the set of passed open
|
||||
// channels. The set of hop hints will be returned as a slice of functional
|
||||
// options that'll append the route hint to the set of all route hints.
|
||||
//
|
||||
// TODO(roasbeef): do proper sub-set sum max hints usually << numChans
|
||||
func selectHopHints(amtMSat lnwire.MilliSatoshi, cfg *AddInvoiceConfig,
|
||||
func SelectHopHints(amtMSat lnwire.MilliSatoshi, cfg *AddInvoiceConfig,
|
||||
openChannels []*channeldb.OpenChannel,
|
||||
numMaxHophints int) []func(*zpay32.Invoice) {
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue