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:
6 files changed
+460
-372
No files matched your search
@@ -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,
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user