multi: extract wallet initialization

With this commit we extract the wallet creation/unlocking and
initialization completely out of the main function. This will allow us
to use custom implementations in the future.
This commit is contained in:
Oliver Gugger committed 2021-10-08 12:13:15 +02:00
1 parent 047d8ea3bc
commit e1da1f8941
6 files changed
+460 -372

No files matched your search

+9 -6
View File
@@ -1538,13 +1538,16 @@ func (c *Config) graphDatabaseDir() string {
// ImplementationConfig returns the configuration of what actual implementations
// should be used when creating the main lnd instance.
func (c *Config) ImplementationConfig() *ImplementationCfg {
defaultImpl := &DefaultWalletImpl{}
func (c *Config) ImplementationConfig(
interceptor signal.Interceptor) *ImplementationCfg {
defaultImpl := NewDefaultWalletImpl(c, ltndLog, interceptor)
return &ImplementationCfg{
GrpcRegistrar: defaultImpl,
RestRegistrar: defaultImpl,
ExternalValidator: defaultImpl,
DatabaseBuilder: NewDefaultDatabaseBuilder(c, ltndLog),
GrpcRegistrar: defaultImpl,
RestRegistrar: defaultImpl,
ExternalValidator: defaultImpl,
DatabaseBuilder: NewDefaultDatabaseBuilder(c, ltndLog),
ChainControlBuilder: defaultImpl,
}
}