Merge pull request #3553 from filecoin-project/fix/panic-in-expired-slashed

Fix panic in OnDealExpiredSlashed
This commit is contained in:
Łukasz Magiera 2020-09-05 21:49:54 +02:00 committed by GitHub
commit 145493388a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -351,6 +351,11 @@ func (c *ClientNodeAdapter) OnDealExpiredOrSlashed(ctx context.Context, dealID a
// Called immediately to check if the deal has already expired or been slashed
checkFunc := func(ts *types.TipSet) (done bool, more bool, err error) {
if ts == nil {
// keep listening for events
return false, true, nil
}
// Check if the deal has already expired
if sd.Proposal.EndEpoch <= ts.Height() {
onDealExpired(nil)