From 8f57dcf28fd16efbc828241fd96418804457c887 Mon Sep 17 00:00:00 2001 From: "Johan T. Halseth" Date: Wed, 31 Mar 2021 12:42:02 +0200 Subject: [PATCH] routerrpc: validate DestFeatures from RPC --- lnrpc/routerrpc/router_backend.go | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/lnrpc/routerrpc/router_backend.go b/lnrpc/routerrpc/router_backend.go index 9cf2c710c..66b7244cd 100644 --- a/lnrpc/routerrpc/router_backend.go +++ b/lnrpc/routerrpc/router_backend.go @@ -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 {