From 09194aa6133c4a7344dad81d343b9c15c4d30238 Mon Sep 17 00:00:00 2001 From: whyrusleeping Date: Wed, 2 Sep 2020 15:57:42 -0700 Subject: [PATCH] print better error when losing connection --- cmd/lotus-shed/mempool-stats.go | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/cmd/lotus-shed/mempool-stats.go b/cmd/lotus-shed/mempool-stats.go index b21948065..4c87b5b5a 100644 --- a/cmd/lotus-shed/mempool-stats.go +++ b/cmd/lotus-shed/mempool-stats.go @@ -106,7 +106,10 @@ var mpoolStatsCmd = &cli.Command{ tick := time.Tick(time.Second) for { select { - case u := <-updates: + case u, ok := <-updates: + if !ok { + return fmt.Errorf("connection with lotus node broke") + } switch u.Type { case lapi.MpoolAdd: tracker[u.Message.Cid()] = &msgInfo{