mirror of
https://github.com/lightningnetwork/lnd.git
synced 2025-10-05 18:03:09 +02:00
routerrpc: validate DestFeatures from RPC
This commit is contained in:
@@ -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 {
|
||||
|
Reference in New Issue
Block a user