Skip to content

Commit ce75c20

Browse files
committed
Fix requested block ahead of current block check
1 parent 39a2d17 commit ce75c20

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

arbitrum/apibackend.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -535,7 +535,7 @@ func (a *APIBackend) StateAndHeaderByNumberOrHash(ctx context.Context, blockNrOr
535535
hash, ishash := blockNrOrHash.Hash()
536536
bc := a.BlockChain()
537537
// check if we are not trying to get recent state that is not yet triedb referenced or committed in Blockchain.writeBlockWithState
538-
if ishash && header.Number.Cmp(bc.CurrentBlock().Number) > 0 && bc.GetCanonicalHash(header.Number.Uint64()) != hash {
538+
if ishash && header != nil && header.Number.Cmp(bc.CurrentBlock().Number) > 0 && bc.GetCanonicalHash(header.Number.Uint64()) != hash {
539539
return nil, nil, errors.New("requested block ahead of current block and the hash is not currently canonical")
540540
}
541541
return a.stateAndHeaderFromHeader(ctx, header, err)

0 commit comments

Comments
 (0)