From 8f9bf7330e260c3d7a345ab9723e099268bf8617 Mon Sep 17 00:00:00 2001 From: George Tsagkarelis Date: Thu, 12 Dec 2024 13:33:14 +0100 Subject: [PATCH] lndclient: thread through all params for AddHoldInvoice --- invoices_client.go | 21 +++++++++++++++------ 1 file changed, 15 insertions(+), 6 deletions(-) diff --git a/invoices_client.go b/invoices_client.go index a154384..452e1ef 100644 --- a/invoices_client.go +++ b/invoices_client.go @@ -3,6 +3,7 @@ package lndclient import ( "context" "errors" + "fmt" "io" "sync" "time" @@ -228,13 +229,21 @@ func (s *invoicesClient) AddHoldInvoice(ctx context.Context, rpcCtx, cancel := context.WithTimeout(ctx, s.timeout) defer cancel() + routeHints, err := marshallRouteHints(in.RouteHints) + if err != nil { + return "", fmt.Errorf("failed to marshal route hints: %v", err) + } + rpcIn := &invoicesrpc.AddHoldInvoiceRequest{ - Memo: in.Memo, - Hash: in.Hash[:], - ValueMsat: int64(in.Value), - Expiry: in.Expiry, - CltvExpiry: in.CltvExpiry, - Private: true, + Memo: in.Memo, + Hash: in.Hash[:], + ValueMsat: int64(in.Value), + Expiry: in.Expiry, + CltvExpiry: in.CltvExpiry, + Private: in.Private, + RouteHints: routeHints, + DescriptionHash: in.DescriptionHash, + FallbackAddr: in.FallbackAddr, } rpcCtx = s.invoiceMac.WithMacaroonAuth(rpcCtx)