fix(events,gateway): check that filter.FromHeight isn't too far back for gateway calls
This commit is contained in:
parent
d5f4d807d7
commit
018b7662d5
@ -441,6 +441,11 @@ func (gw *Node) GetActorEvents(ctx context.Context, filter *types.ActorEventFilt
|
||||
if err := gw.limit(ctx, stateRateLimitTokens); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if filter != nil && filter.FromHeight != nil {
|
||||
if err := gw.checkTipSetHeight(ctx, *filter.FromHeight, types.EmptyTSK); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
}
|
||||
return gw.target.GetActorEvents(ctx, filter)
|
||||
}
|
||||
|
||||
@ -448,6 +453,11 @@ func (gw *Node) SubscribeActorEvents(ctx context.Context, filter *types.ActorEve
|
||||
if err := gw.limit(ctx, stateRateLimitTokens); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if filter != nil && filter.FromHeight != nil {
|
||||
if err := gw.checkTipSetHeight(ctx, *filter.FromHeight, types.EmptyTSK); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
}
|
||||
return gw.target.SubscribeActorEvents(ctx, filter)
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user