From ad4e1e971e0920fe5bb47fbafc623fe84af15123 Mon Sep 17 00:00:00 2001 From: Oliver Gugger Date: Wed, 22 Apr 2020 15:53:44 +0200 Subject: [PATCH] loopd: check lnd version and subservers --- loopd/start.go | 24 ++++++++++++++++++++---- 1 file changed, 20 insertions(+), 4 deletions(-) diff --git a/loopd/start.go b/loopd/start.go index 69b462c..9b49b54 100644 --- a/loopd/start.go +++ b/loopd/start.go @@ -12,10 +12,25 @@ import ( "github.com/lightninglabs/loop" "github.com/lightninglabs/loop/lndclient" "github.com/lightningnetwork/lnd/build" + "github.com/lightningnetwork/lnd/lnrpc/verrpc" ) const defaultConfigFilename = "loopd.conf" +var ( + // LoopMinRequiredLndVersion is the minimum required version of lnd that + // is compatible with the current version of the loop client. Also all + // listed build tags/subservers need to be enabled. + LoopMinRequiredLndVersion = &verrpc.Version{ + AppMajor: 0, + AppMinor: 10, + AppPatch: 0, + BuildTags: []string{ + "signrpc", "walletrpc", "chainrpc", "invoicesrpc", + }, + } +) + // RPCConfig holds optional options that can be used to make the loop daemon // communicate on custom connections. type RPCConfig struct { @@ -55,10 +70,11 @@ func newListenerCfg(config *config, rpcCfg RPCConfig) *listenerCfg { *lndclient.GrpcLndServices, error) { svcCfg := &lndclient.LndServicesConfig{ - LndAddress: cfg.Host, - Network: network, - MacaroonDir: cfg.MacaroonDir, - TLSPath: cfg.TLSPath, + LndAddress: cfg.Host, + Network: network, + MacaroonDir: cfg.MacaroonDir, + TLSPath: cfg.TLSPath, + CheckVersion: LoopMinRequiredLndVersion, } // If a custom lnd connection is specified we use that