server: store the version of the connected lnd node
We'll use this in a follow up commit to decide what channel type we want
to use.
@@ -52,6 +52,18 @@ var (
"signrpc", "walletrpc", "chainrpc", "invoicesrpc",
},
}
+
+ // scriptEnforceVersion is the version of lnd that enabled lease duration script
+ // enforcement as a new channel type. We'll use this to decide what
+ // order type to default to.
+ scriptEnforceVersion = &verrpc.Version{
+ AppMajor: 0,
+ AppMinor: 14,
+ AppPatch: 0,
+ BuildTags: []string{
+ "signrpc", "walletrpc", "chainrpc", "invoicesrpc",
+ },
+ }
)
// Server is the main poold trader server.
@@ -71,6 +83,8 @@ type Server struct {
// client or an error if none has been established yet.
GetIdentity func() (*lsat.TokenID, error)
+ lndVersion *verrpc.Version
+
cfg *Config
db *clientdb.DB
fundingManager *funding.Manager
@@ -128,6 +142,11 @@ func (s *Server) Start() error {
return nil
}
+ // Now that we have lnd, lets extract the current version so we can use
+ // this to gate features that we'll use based on the functionality
+ // available.
+ s.lndVersion = s.lndServices.Version
+
// As there're some other lower-level operations we may need access to,
// we'll also make a connection for a "basic client".
//
