Skip to content

Commit d07bfd1

Browse files
GeorgeTsagkguggero
authored andcommitted
rpcserver: fix case of existing route hints in AddInvoice
1 parent 6e0f9ed commit d07bfd1

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
@@ -8163,9 +8163,19 @@ func (r *rpcServer) AddInvoice(ctx context.Context,
81638163
var expensiveQuote *rfqrpc.PeerAcceptedBuyQuote
81648164
if !existingQuotes {
81658165
expensiveQuote = acquiredQuotes[0].quote
8166+
} else {
8167+
mgr := r.cfg.AuxInvoiceManager
8168+
buyQuote, err := mgr.GetBuyQuoteFromRouteHints(
8169+
iReq, specifier,
8170+
)
8171+
if err != nil {
8172+
return nil, fmt.Errorf("failed to find matching buy "+
8173+
"quote in accepted quotes: %w", err)
8174+
}
8175+
8176+
expensiveQuote = marshalPeerAcceptedBuyQuote(*buyQuote)
81668177
}
81678178

8168-
// replace with above
81698179
// Now that we have the accepted quote, we know the amount in (milli)
81708180
// Satoshi that we need to pay. We can now update the invoice with this
81718181
// amount.

0 commit comments

Comments
 (0)