markets: Fix deal expired panic
This commit is contained in:
parent
c11803ad55
commit
b8bba15ed2
@ -264,7 +264,7 @@ func (c *ClientNodeAdapter) OnDealExpiredOrSlashed(ctx context.Context, dealID a
|
|||||||
// and the chain has advanced to the confidence height
|
// 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) {
|
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
|
// Check if the deal has already expired
|
||||||
if sd.Proposal.EndEpoch <= ts2.Height() {
|
if ts2 == nil || sd.Proposal.EndEpoch <= ts2.Height() {
|
||||||
onDealExpired(nil)
|
onDealExpired(nil)
|
||||||
return false, nil
|
return false, nil
|
||||||
}
|
}
|
||||||
|
@ -344,7 +344,7 @@ func (n *ProviderNodeAdapter) OnDealExpiredOrSlashed(ctx context.Context, dealID
|
|||||||
// and the chain has advanced to the confidence height
|
// 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) {
|
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
|
// Check if the deal has already expired
|
||||||
if sd.Proposal.EndEpoch <= ts2.Height() {
|
if ts2 == nil || sd.Proposal.EndEpoch <= ts2.Height() {
|
||||||
onDealExpired(nil)
|
onDealExpired(nil)
|
||||||
return false, nil
|
return false, nil
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user