Eth API: fail when requesting future epochs.
This commit is contained in:
parent
cef416e2b0
commit
28d8b4cd65
@ -254,6 +254,9 @@ func (a *EthModule) parseBlkParam(ctx context.Context, blkParam string, strict b
|
||||
if err != nil {
|
||||
return nil, fmt.Errorf("cannot parse block number: %v", err)
|
||||
}
|
||||
if abi.ChainEpoch(num) > head.Height()-1 {
|
||||
return nil, fmt.Errorf("requested a future epoch (beyond 'latest')")
|
||||
}
|
||||
ts, err := a.Chain.GetTipsetByHeight(ctx, abi.ChainEpoch(num), nil, true)
|
||||
if err != nil {
|
||||
return nil, fmt.Errorf("cannot get tipset at height: %v", num)
|
||||
|
Loading…
Reference in New Issue
Block a user