mirror of
https://github.com/lightningnetwork/lnd.git
synced 2025-09-26 04:56:52 +02:00
Merge pull request #8886 from bitromortac/buildroute-inbound-fees
routing: inbound fees support for BuildRoute
This commit is contained in:
@@ -15,6 +15,7 @@ import (
|
||||
"github.com/btcsuite/btcd/wire"
|
||||
"github.com/grpc-ecosystem/grpc-gateway/v2/runtime"
|
||||
"github.com/lightningnetwork/lnd/channeldb"
|
||||
"github.com/lightningnetwork/lnd/fn"
|
||||
"github.com/lightningnetwork/lnd/lnrpc"
|
||||
"github.com/lightningnetwork/lnd/lnrpc/invoicesrpc"
|
||||
"github.com/lightningnetwork/lnd/lntypes"
|
||||
@@ -1400,6 +1401,10 @@ func (s *Server) trackPaymentStream(context context.Context,
|
||||
func (s *Server) BuildRoute(_ context.Context,
|
||||
req *BuildRouteRequest) (*BuildRouteResponse, error) {
|
||||
|
||||
if len(req.HopPubkeys) == 0 {
|
||||
return nil, errors.New("no hops specified")
|
||||
}
|
||||
|
||||
// Unmarshall hop list.
|
||||
hops := make([]route.Vertex, len(req.HopPubkeys))
|
||||
for i, pubkeyBytes := range req.HopPubkeys {
|
||||
@@ -1411,10 +1416,10 @@ func (s *Server) BuildRoute(_ context.Context,
|
||||
}
|
||||
|
||||
// Prepare BuildRoute call parameters from rpc request.
|
||||
var amt *lnwire.MilliSatoshi
|
||||
var amt fn.Option[lnwire.MilliSatoshi]
|
||||
if req.AmtMsat != 0 {
|
||||
rpcAmt := lnwire.MilliSatoshi(req.AmtMsat)
|
||||
amt = &rpcAmt
|
||||
amt = fn.Some(rpcAmt)
|
||||
}
|
||||
|
||||
var outgoingChan *uint64
|
||||
|
Reference in New Issue
Block a user