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))