From c1979f2c7f87e983634e7c9b2697b65fcccc3502 Mon Sep 17 00:00:00 2001 From: hannahhoward Date: Wed, 26 Feb 2020 15:48:07 -0800 Subject: [PATCH] fix(markets): detect storage deal active correctly Use SectorStartEpoch to determine if a deal is active, rather than Proposal.StartEpoch --- markets/storageadapter/client.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/markets/storageadapter/client.go b/markets/storageadapter/client.go index 34cd5352c..be0fab1ca 100644 --- a/markets/storageadapter/client.go +++ b/markets/storageadapter/client.go @@ -234,7 +234,7 @@ func (c *ClientNodeAdapter) OnDealSectorCommitted(ctx context.Context, provider return false, false, xerrors.Errorf("failed to look up deal on chain: %w", err) } - if sd.Proposal.StartEpoch > 0 { + if sd.State.SectorStartEpoch > 0 { cb(nil) return true, false, nil } @@ -259,7 +259,7 @@ func (c *ClientNodeAdapter) OnDealSectorCommitted(ctx context.Context, provider return false, xerrors.Errorf("failed to look up deal on chain: %w", err) } - if sd.Proposal.StartEpoch == 0 { + if sd.State.SectorStartEpoch < 1 { return false, xerrors.Errorf("deal wasn't active: deal=%d, parentState=%s, h=%d", dealId, ts.ParentState(), ts.Height()) }