mirror of
https://github.com/lightningnetwork/lnd.git
synced 2025-03-03 17:26:57 +01:00
lnd+pilot: use minHTLCIn instead of whole config
To remove one more direct dependency to a variable in our main function, we pass in the required parameter to the autopilot only instead of the whole chain configuration.
This commit is contained in:
parent
cab800e1e7
commit
862f712394
2 changed files with 6 additions and 3 deletions
5
lnd.go
5
lnd.go
|
@ -894,7 +894,10 @@ func Main(cfg *Config, lisCfg ListenerCfg, interceptor signal.Interceptor) error
|
||||||
// Set up an autopilot manager from the current config. This will be
|
// Set up an autopilot manager from the current config. This will be
|
||||||
// used to manage the underlying autopilot agent, starting and stopping
|
// used to manage the underlying autopilot agent, starting and stopping
|
||||||
// it at will.
|
// it at will.
|
||||||
atplCfg, err := initAutoPilot(server, cfg.Autopilot, mainChain, cfg.ActiveNetParams)
|
atplCfg, err := initAutoPilot(
|
||||||
|
server, cfg.Autopilot, activeChainControl.MinHtlcIn,
|
||||||
|
cfg.ActiveNetParams,
|
||||||
|
)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
err := fmt.Errorf("unable to initialize autopilot: %v", err)
|
err := fmt.Errorf("unable to initialize autopilot: %v", err)
|
||||||
ltndLog.Error(err)
|
ltndLog.Error(err)
|
||||||
|
|
4
pilot.go
4
pilot.go
|
@ -137,7 +137,7 @@ var _ autopilot.ChannelController = (*chanController)(nil)
|
||||||
// interfaces needed to drive it won't be launched before the Manager's
|
// interfaces needed to drive it won't be launched before the Manager's
|
||||||
// StartAgent method is called.
|
// StartAgent method is called.
|
||||||
func initAutoPilot(svr *server, cfg *lncfg.AutoPilot,
|
func initAutoPilot(svr *server, cfg *lncfg.AutoPilot,
|
||||||
chainCfg *lncfg.Chain, netParams chainreg.BitcoinNetParams) (
|
minHTLCIn lnwire.MilliSatoshi, netParams chainreg.BitcoinNetParams) (
|
||||||
*autopilot.ManagerCfg, error) {
|
*autopilot.ManagerCfg, error) {
|
||||||
|
|
||||||
atplLog.Infof("Instantiating autopilot with active=%v, "+
|
atplLog.Infof("Instantiating autopilot with active=%v, "+
|
||||||
|
@ -177,7 +177,7 @@ func initAutoPilot(svr *server, cfg *lncfg.AutoPilot,
|
||||||
private: cfg.Private,
|
private: cfg.Private,
|
||||||
minConfs: cfg.MinConfs,
|
minConfs: cfg.MinConfs,
|
||||||
confTarget: cfg.ConfTarget,
|
confTarget: cfg.ConfTarget,
|
||||||
chanMinHtlcIn: chainCfg.MinHTLCIn,
|
chanMinHtlcIn: minHTLCIn,
|
||||||
netParams: netParams,
|
netParams: netParams,
|
||||||
},
|
},
|
||||||
WalletBalance: func() (btcutil.Amount, error) {
|
WalletBalance: func() (btcutil.Amount, error) {
|
||||||
|
|
Loading…
Add table
Reference in a new issue