Skip to content

Commit

Permalink
Merge pull request #5216 from filecoin-project/fix/fix-dealexp-panic
Browse files Browse the repository at this point in the history
markets: Fix deal expired panic
  • Loading branch information
magik6k authored Dec 17, 2020
2 parents c11803a + b8bba15 commit 19d457a
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion markets/storageadapter/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -264,7 +264,7 @@ func (c *ClientNodeAdapter) OnDealExpiredOrSlashed(ctx context.Context, dealID a
// and the chain has advanced to the confidence height
stateChanged := func(ts *types.TipSet, ts2 *types.TipSet, states events.StateChange, h abi.ChainEpoch) (more bool, err error) {
// Check if the deal has already expired
if sd.Proposal.EndEpoch <= ts2.Height() {
if ts2 == nil || sd.Proposal.EndEpoch <= ts2.Height() {
onDealExpired(nil)
return false, nil
}
Expand Down
2 changes: 1 addition & 1 deletion markets/storageadapter/provider.go
Original file line number Diff line number Diff line change
Expand Up @@ -344,7 +344,7 @@ func (n *ProviderNodeAdapter) OnDealExpiredOrSlashed(ctx context.Context, dealID
// and the chain has advanced to the confidence height
stateChanged := func(ts *types.TipSet, ts2 *types.TipSet, states events.StateChange, h abi.ChainEpoch) (more bool, err error) {
// Check if the deal has already expired
if sd.Proposal.EndEpoch <= ts2.Height() {
if ts2 == nil || sd.Proposal.EndEpoch <= ts2.Height() {
onDealExpired(nil)
return false, nil
}
Expand Down

0 comments on commit 19d457a

Please sign in to comment.