Skip to content

Commit

Permalink
Merge pull request #204 from GeorgeTsagk/addholdinvoice-params
Browse files Browse the repository at this point in the history
Expose all params for `AddHoldInvoice`
  • Loading branch information
GeorgeTsagk authored Dec 12, 2024
2 parents 4602d41 + 8f9bf73 commit f8f7e3f
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 f8f7e3f

Please sign in to comment.