From 2a0eddc83ab5ff9fe9d94e1ce6022d0c2edc4e61 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 e364bc4a4a1b0914b92c27c49a3268f6796fad6c 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 {