print better error when losing connection

This commit is contained in:
whyrusleeping 2020-09-02 15:57:42 -07:00
parent e58327d4ed
commit 09194aa613

View File

@ -106,7 +106,10 @@ var mpoolStatsCmd = &cli.Command{
tick := time.Tick(time.Second) tick := time.Tick(time.Second)
for { for {
select { select {
case u := <-updates: case u, ok := <-updates:
if !ok {
return fmt.Errorf("connection with lotus node broke")
}
switch u.Type { switch u.Type {
case lapi.MpoolAdd: case lapi.MpoolAdd:
tracker[u.Message.Cid()] = &msgInfo{ tracker[u.Message.Cid()] = &msgInfo{