lnd+pilot+autopilot: use config to set active autopilot heuristics
This commit is contained in:
parent
36e7694e8e
commit
8ab718368d
12
pilot.go
12
pilot.go
@ -148,15 +148,13 @@ func initAutoPilot(svr *server, cfg *autoPilotConfig) (*autopilot.ManagerCfg, er
|
|||||||
10,
|
10,
|
||||||
cfg.Allocation,
|
cfg.Allocation,
|
||||||
)
|
)
|
||||||
|
heuristics, err := validateAtplCfg(cfg)
|
||||||
// First, we'll create the preferential attachment heuristic.
|
if err != nil {
|
||||||
prefAttachment := autopilot.NewPrefAttachment()
|
return nil, err
|
||||||
|
}
|
||||||
|
|
||||||
weightedAttachment, err := autopilot.NewWeightedCombAttachment(
|
weightedAttachment, err := autopilot.NewWeightedCombAttachment(
|
||||||
&autopilot.WeightedHeuristic{
|
heuristics...,
|
||||||
Weight: 1.0,
|
|
||||||
AttachmentHeuristic: prefAttachment,
|
|
||||||
},
|
|
||||||
)
|
)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
|
Loading…
Reference in New Issue
Block a user