add nil check in tipset change handler

This commit is contained in:
Ingar Shu 2020-08-12 14:27:39 -07:00
parent c73d597d87
commit 43e1b57c3f
No known key found for this signature in database
GPG Key ID: BE3D9CE79F22E769

View File

@ -379,6 +379,11 @@ func (n *ProviderNodeAdapter) OnDealExpiredOrSlashed(ctx context.Context, dealID
// Called immediately to check if the deal has already expired or been slashed // Called immediately to check if the deal has already expired or been slashed
checkFunc := func(ts *types.TipSet) (done bool, more bool, err error) { 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 // Check if the deal has already expired
if sd.Proposal.EndEpoch <= ts.Height() { if sd.Proposal.EndEpoch <= ts.Height() {
onDealExpired(nil) onDealExpired(nil)