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.
This commit is contained in:
Olaoluwa Osuntokun 2021-12-16 17:00:59 -08:00
parent 67fb1b4b97
commit eecb470538
No known key found for this signature in database
GPG key ID: 3BBD59E99B280306

View file

@ -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".
//