Skip to content

Commit ad4e1e9

Browse files
committed
loopd: check lnd version and subservers
1 parent 3da09aa commit ad4e1e9

File tree

1 file changed

+20
-4
lines changed

1 file changed

+20
-4
lines changed

loopd/start.go

Lines changed: 20 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,10 +12,25 @@ import (
1212
"github.com/lightninglabs/loop"
1313
"github.com/lightninglabs/loop/lndclient"
1414
"github.com/lightningnetwork/lnd/build"
15+
"github.com/lightningnetwork/lnd/lnrpc/verrpc"
1516
)
1617

1718
const defaultConfigFilename = "loopd.conf"
1819

20+
var (
21+
// LoopMinRequiredLndVersion is the minimum required version of lnd that
22+
// is compatible with the current version of the loop client. Also all
23+
// listed build tags/subservers need to be enabled.
24+
LoopMinRequiredLndVersion = &verrpc.Version{
25+
AppMajor: 0,
26+
AppMinor: 10,
27+
AppPatch: 0,
28+
BuildTags: []string{
29+
"signrpc", "walletrpc", "chainrpc", "invoicesrpc",
30+
},
31+
}
32+
)
33+
1934
// RPCConfig holds optional options that can be used to make the loop daemon
2035
// communicate on custom connections.
2136
type RPCConfig struct {
@@ -55,10 +70,11 @@ func newListenerCfg(config *config, rpcCfg RPCConfig) *listenerCfg {
5570
*lndclient.GrpcLndServices, error) {
5671

5772
svcCfg := &lndclient.LndServicesConfig{
58-
LndAddress: cfg.Host,
59-
Network: network,
60-
MacaroonDir: cfg.MacaroonDir,
61-
TLSPath: cfg.TLSPath,
73+
LndAddress: cfg.Host,
74+
Network: network,
75+
MacaroonDir: cfg.MacaroonDir,
76+
TLSPath: cfg.TLSPath,
77+
CheckVersion: LoopMinRequiredLndVersion,
6278
}
6379

6480
// If a custom lnd connection is specified we use that

0 commit comments

Comments
 (0)