invoicerpc: Allow user specify routing hints.

This commit is contained in:
Roei Erez
2019-11-03 15:00:27 +02:00
committed by Roei Erez
parent 1c96cc7e10
commit 4463a4ce17
5 changed files with 141 additions and 2 deletions

View File

@ -4745,6 +4745,11 @@ func (r *rpcServer) AddInvoice(ctx context.Context,
return nil, err
}
// Convert the passed routing hints to the required format.
routeHints, err := invoicesrpc.CreateZpay32HopHints(invoice.RouteHints)
if err != nil {
return nil, err
}
addInvoiceData := &invoicesrpc.AddInvoiceData{
Memo: invoice.Memo,
Value: value,
@ -4753,6 +4758,7 @@ func (r *rpcServer) AddInvoice(ctx context.Context,
FallbackAddr: invoice.FallbackAddr,
CltvExpiry: invoice.CltvExpiry,
Private: invoice.Private,
RouteHints: routeHints,
}
if invoice.RPreimage != nil {