From 6144f1af738855e7049a31c329e9ea4c0a507fde Mon Sep 17 00:00:00 2001 From: whyrusleeping Date: Thu, 29 Aug 2019 20:25:31 -0700 Subject: [PATCH] handle channel closing properly --- chain/store/store.go | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/chain/store/store.go b/chain/store/store.go index c8c82d5ec..8c35e4564 100644 --- a/chain/store/store.go +++ b/chain/store/store.go @@ -576,7 +576,10 @@ func (cs *ChainStore) WaitForMessage(ctx context.Context, mcid cid.Cid) (cid.Cid for { select { - case val := <-tsub: + case val, ok := <-tsub: + if !ok { + return cid.Undef, nil, ctx.Err() + } switch val.Type { case HCRevert: continue