From 2fecf3a8f1c33676890a3c7f443416d46dd603bd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C5=81ukasz=20Magiera?= Date: Mon, 13 Jan 2020 21:51:34 +0100 Subject: [PATCH] Fix tests --- cmd/lotus-townhall/main.go | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/cmd/lotus-townhall/main.go b/cmd/lotus-townhall/main.go index 8e7e78008..a52fdcf66 100644 --- a/cmd/lotus-townhall/main.go +++ b/cmd/lotus-townhall/main.go @@ -27,6 +27,11 @@ var topic = "/fil/headnotifs/" func init() { genBytes := build.MaybeGenesis() + if len(genBytes) == 0 { + topic = "" + return + } + bs := blockstore.NewBlockstore(datastore.NewMapDatastore()) c, err := car.LoadCar(bs, bytes.NewReader(genBytes)) @@ -49,6 +54,11 @@ var upgrader = websocket.Upgrader{ } func main() { + if topic == "" { + fmt.Println("FATAL: No genesis found") + return + } + ctx := context.Background() protec, err := pnet.NewProtector(strings.NewReader(lp2p.LotusKey))