lnrpc+routing: convert amt pointer to fn.Option

This commit is contained in:
bitromortac committed 2024-08-07 14:24:56 +02:00
1 parent 8b32e3e785
commit 452db01ad7
3 files changed
+55 -54

No files matched your search

+3 -2
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