lnrpc+routing: convert amt pointer to fn.Option

This commit is contained in:
bitromortac
2024-07-31 14:32:48 +02:00
parent 8b32e3e785
commit 452db01ad7
3 changed files with 55 additions and 54 deletions

View File

@@ -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"
@@ -1411,10 +1412,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