diff --git a/api/types.go b/api/types.go index ea296efb0..588227de2 100644 --- a/api/types.go +++ b/api/types.go @@ -18,10 +18,12 @@ const ( DealSealing DealComplete - // Client specific + // Internal DealError // deal failed with an unexpected error DealExpired + + DealNoUpdate = DealUnknown ) // TODO: check if this exists anywhere else diff --git a/chain/deals/handler.go b/chain/deals/handler.go index 2e6457f59..98f789294 100644 --- a/chain/deals/handler.go +++ b/chain/deals/handler.go @@ -189,6 +189,8 @@ func (h *Handler) onUpdated(ctx context.Context, update minerDealUpdate) { h.handle(ctx, deal, h.staged, api.DealSealing) case api.DealSealing: h.handle(ctx, deal, h.sealing, api.DealComplete) + case api.DealComplete: + h.handle(ctx, deal, h.complete, api.DealNoUpdate) } } diff --git a/chain/deals/handler_states.go b/chain/deals/handler_states.go index 224f89299..fc1b122c5 100644 --- a/chain/deals/handler_states.go +++ b/chain/deals/handler_states.go @@ -22,6 +22,11 @@ type minerHandlerFunc func(ctx context.Context, deal MinerDeal) (func(*MinerDeal func (h *Handler) handle(ctx context.Context, deal MinerDeal, cb minerHandlerFunc, next api.DealState) { go func() { mut, err := cb(ctx, deal) + + if err == nil && next == api.DealNoUpdate { + return + } + select { case h.updated <- minerDealUpdate{ newState: next,