@@ -107,7 +107,7 @@ type DatabaseBuilder interface {
107107type WalletConfigBuilder interface {
108108 // BuildWalletConfig is responsible for creating or unlocking and then
109109 // fully initializing a wallet.
110- BuildWalletConfig (context.Context , * DatabaseInstances ,
110+ BuildWalletConfig (context.Context , * DatabaseInstances , * AuxComponents ,
111111 * rpcperms.InterceptorChain ,
112112 []* ListenerWithSignal ) (* chainreg.PartialChainControl ,
113113 * btcwallet.Config , func (), error )
@@ -149,15 +149,31 @@ type ImplementationCfg struct {
149149 // implementation.
150150 ChainControlBuilder
151151
152+ // AuxComponents is a set of auxiliary components that can be used by
153+ // lnd for certain custom channel types.
154+ AuxComponents
155+ }
156+
157+ // AuxComponents is a set of auxiliary components that can be used by lnd for
158+ // certain custom channel types.
159+ type AuxComponents struct {
160+ // AuxLeafStore is an optional data source that can be used by custom
161+ // channels to fetch+store various data.
162+ AuxLeafStore fn.Option [lnwallet.AuxLeafStore ]
163+
152164 // MsgRouter is an optional message router that if set will be used in
153165 // place of a new balnk default message router.
154166 MsgRouter fn.Option [protofsm.MsgRouter ]
155167
156168 // AuxFundingController is an optional controller that can be used to
157- // modify the way we handle certain custom chanenl types. It's also
169+ // modify the way we handle certain custom channel types. It's also
158170 // able to automatically handle new custom protocol messages related to
159171 // the funding process.
160172 AuxFundingController fn.Option [funding.AuxFundingController ]
173+
174+ // AuxSigner is an optional signer that can be used to sign auxiliary
175+ // leaves for certain custom channel types.
176+ AuxSigner fn.Option [lnwallet.AuxSigner ]
161177}
162178
163179// DefaultWalletImpl is the default implementation of our normal, btcwallet
@@ -242,7 +258,8 @@ func (d *DefaultWalletImpl) Permissions() map[string][]bakery.Op {
242258//
243259// NOTE: This is part of the WalletConfigBuilder interface.
244260func (d * DefaultWalletImpl ) BuildWalletConfig (ctx context.Context ,
245- dbs * DatabaseInstances , interceptorChain * rpcperms.InterceptorChain ,
261+ dbs * DatabaseInstances , aux * AuxComponents ,
262+ interceptorChain * rpcperms.InterceptorChain ,
246263 grpcListeners []* ListenerWithSignal ) (* chainreg.PartialChainControl ,
247264 * btcwallet.Config , func (), error ) {
248265
@@ -561,7 +578,8 @@ func (d *DefaultWalletImpl) BuildWalletConfig(ctx context.Context,
561578 BtcdMode : d .cfg .BtcdMode ,
562579 HeightHintDB : dbs .HeightHintDB ,
563580 ChanStateDB : dbs .ChanStateDB .ChannelStateDB (),
564- AuxLeafStore : dbs .AuxLeafStore ,
581+ AuxLeafStore : aux .AuxLeafStore ,
582+ AuxSigner : aux .AuxSigner ,
565583 NeutrinoCS : neutrinoCS ,
566584 ActiveNetParams : d .cfg .ActiveNetParams ,
567585 FeeURL : d .cfg .FeeURL ,
@@ -621,8 +639,9 @@ func (d *DefaultWalletImpl) BuildWalletConfig(ctx context.Context,
621639
622640// proxyBlockEpoch proxies a block epoch subsections to the underlying neutrino
623641// rebroadcaster client.
624- func proxyBlockEpoch (notifier chainntnfs.ChainNotifier ,
625- ) func () (* blockntfns.Subscription , error ) {
642+ func proxyBlockEpoch (
643+ notifier chainntnfs.ChainNotifier ) func () (* blockntfns.Subscription ,
644+ error ) {
626645
627646 return func () (* blockntfns.Subscription , error ) {
628647 blockEpoch , err := notifier .RegisterBlockEpochNtfn (
@@ -714,6 +733,7 @@ func (d *DefaultWalletImpl) BuildChainControl(
714733 NetParams : * walletConfig .NetParams ,
715734 CoinSelectionStrategy : walletConfig .CoinSelectionStrategy ,
716735 AuxLeafStore : partialChainControl .Cfg .AuxLeafStore ,
736+ AuxSigner : partialChainControl .Cfg .AuxSigner ,
717737 }
718738
719739 // The broadcast is already always active for neutrino nodes, so we
@@ -893,10 +913,6 @@ type DatabaseInstances struct {
893913 // for native SQL queries for tables that already support it. This may
894914 // be nil if the use-native-sql flag was not set.
895915 NativeSQLStore * sqldb.BaseDB
896-
897- // AuxLeafStore is an optional data source that can be used by custom
898- // channels to fetch+store various data.
899- AuxLeafStore fn.Option [lnwallet.AuxLeafStore ]
900916}
901917
902918// DefaultDatabaseBuilder is a type that builds the default database backends
0 commit comments