From e9b2ff8b4feaa82627a799c3da26cf46c9aa902a Mon Sep 17 00:00:00 2001 From: Moses Narrow Date: Mon, 15 Aug 2022 13:53:08 -0500 Subject: [PATCH 1/2] fix autopeering runs only with no local or remote hypervisors logic --- cmd/skywire-visor/commands/root.go | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/cmd/skywire-visor/commands/root.go b/cmd/skywire-visor/commands/root.go index f04f46e558..6b62128fd1 100644 --- a/cmd/skywire-visor/commands/root.go +++ b/cmd/skywire-visor/commands/root.go @@ -290,10 +290,11 @@ func runVisor(conf *visorconfig.V1) { } } //autopeering should only happen when there is no local or remote hypervisor set in the config. + if conf.Hypervisor != nil { + isAutoPeer = false + } if conf.Hypervisors != nil { - if conf.Hypervisor != nil { - isAutoPeer = false - } + isAutoPeer = false } if isAutoPeer { hvkey, err := visor.FetchHvPk(autoPeerIP) From e18ef37327d64c0415c160a1bfc8199bd121bd4f Mon Sep 17 00:00:00 2001 From: Moses Narrow Date: Tue, 16 Aug 2022 11:04:08 -0500 Subject: [PATCH 2/2] optimize autopeering disable logic --- cmd/skywire-visor/commands/root.go | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/cmd/skywire-visor/commands/root.go b/cmd/skywire-visor/commands/root.go index 6b62128fd1..c668bb318f 100644 --- a/cmd/skywire-visor/commands/root.go +++ b/cmd/skywire-visor/commands/root.go @@ -290,10 +290,7 @@ func runVisor(conf *visorconfig.V1) { } } //autopeering should only happen when there is no local or remote hypervisor set in the config. - if conf.Hypervisor != nil { - isAutoPeer = false - } - if conf.Hypervisors != nil { + if conf.Hypervisor != nil || conf.Hypervisors != nil { isAutoPeer = false } if isAutoPeer {