From 8ab718368dfb79c3108735c21bfddef892804a0e Mon Sep 17 00:00:00 2001 From: "Johan T. Halseth" Date: Wed, 19 Dec 2018 18:57:32 +0100 Subject: [PATCH] lnd+pilot+autopilot: use config to set active autopilot heuristics --- pilot.go | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/pilot.go b/pilot.go index 9bfc5cb0..8a5cdd5a 100644 --- a/pilot.go +++ b/pilot.go @@ -148,15 +148,13 @@ func initAutoPilot(svr *server, cfg *autoPilotConfig) (*autopilot.ManagerCfg, er 10, cfg.Allocation, ) - - // First, we'll create the preferential attachment heuristic. - prefAttachment := autopilot.NewPrefAttachment() + heuristics, err := validateAtplCfg(cfg) + if err != nil { + return nil, err + } weightedAttachment, err := autopilot.NewWeightedCombAttachment( - &autopilot.WeightedHeuristic{ - Weight: 1.0, - AttachmentHeuristic: prefAttachment, - }, + heuristics..., ) if err != nil { return nil, err