Skip to content

Commit 049e6a4

Browse files
GeorgeTsagkguggero
authored andcommitted
rpcserver: fix case of existing route hints in AddInvoice
1 parent 8daf417 commit 049e6a4

File tree

1 file changed

+11
-1
lines changed

1 file changed

+11
-1
lines changed

rpcserver.go

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8128,9 +8128,19 @@ func (r *rpcServer) AddInvoice(ctx context.Context,
81288128
var expensiveQuote *rfqrpc.PeerAcceptedBuyQuote
81298129
if !existingQuotes {
81308130
expensiveQuote = acquiredQuotes[0].quote
8131+
} else {
8132+
mgr := r.cfg.AuxInvoiceManager
8133+
buyQuote, err := mgr.GetBuyQuoteFromRouteHints(
8134+
iReq, specifier,
8135+
)
8136+
if err != nil {
8137+
return nil, fmt.Errorf("failed to find matching buy "+
8138+
"quote in accepted quotes: %w", err)
8139+
}
8140+
8141+
expensiveQuote = marshalPeerAcceptedBuyQuote(*buyQuote)
81318142
}
81328143

8133-
// replace with above
81348144
// Now that we have the accepted quote, we know the amount in (milli)
81358145
// Satoshi that we need to pay. We can now update the invoice with this
81368146
// amount.

0 commit comments

Comments
 (0)