Skip to content

Commit

Permalink
lndclient: thread through all params for AddHoldInvoice
Browse files Browse the repository at this point in the history
  • Loading branch information
GeorgeTsagk committed Dec 12, 2024
1 parent 4602d41 commit 8f9bf73
Showing 1 changed file with 15 additions and 6 deletions.
21 changes: 15 additions & 6 deletions invoices_client.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ package lndclient
import (
"context"
"errors"
"fmt"
"io"
"sync"
"time"
Expand Down Expand Up @@ -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)
Expand Down

0 comments on commit 8f9bf73

Please sign in to comment.