Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Expose all params for AddHoldInvoice #204

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading