routerrpc: validate DestFeatures from RPC
This commit is contained in:
parent
0b9137cdac
commit
8f57dcf28f
@ -13,6 +13,7 @@ import (
|
||||
"github.com/btcsuite/btcd/wire"
|
||||
"github.com/btcsuite/btcutil"
|
||||
"github.com/lightningnetwork/lnd/channeldb"
|
||||
"github.com/lightningnetwork/lnd/feature"
|
||||
"github.com/lightningnetwork/lnd/htlcswitch"
|
||||
"github.com/lightningnetwork/lnd/lnrpc"
|
||||
"github.com/lightningnetwork/lnd/lntypes"
|
||||
@ -757,6 +758,14 @@ func (r *RouterBackend) extractIntentFromSendRequest(
|
||||
return nil, err
|
||||
}
|
||||
|
||||
// Validate the features if any was specified.
|
||||
if features != nil {
|
||||
err = feature.ValidateDeps(features)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
}
|
||||
|
||||
// If the payment addresses is specified, then we'll also
|
||||
// populate that now as well.
|
||||
if len(rpcPayReq.PaymentAddr) != 0 {
|
||||
|
Loading…
Reference in New Issue
Block a user