From 835b84b12a49498f6c159ea21a631d1d684f2758 Mon Sep 17 00:00:00 2001 From: Aayush Rajasekaran Date: Wed, 6 Jan 2021 16:03:29 -0500 Subject: [PATCH] Skip bootstrapping if no peers specified --- build/bootstrap.go | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/build/bootstrap.go b/build/bootstrap.go index 98a3f5b0a..cd72cfd1b 100644 --- a/build/bootstrap.go +++ b/build/bootstrap.go @@ -17,10 +17,14 @@ func BuiltinBootstrap() ([]peer.AddrInfo, error) { b := rice.MustFindBox("bootstrap") - spi := b.MustString(BootstrappersFile) - if spi == "" { - return nil, nil + if BootstrappersFile != "" { + spi := b.MustString(BootstrappersFile) + if spi == "" { + return nil, nil + } + + return addrutil.ParseAddresses(context.TODO(), strings.Split(strings.TrimSpace(spi), "\n")) } - return addrutil.ParseAddresses(context.TODO(), strings.Split(strings.TrimSpace(spi), "\n")) + return nil, nil }