Skip to content

Commit

Permalink
eth: check err before return in function StateAndHeaderByNumber
Browse files Browse the repository at this point in the history
  • Loading branch information
gzliudan committed Mar 12, 2024
1 parent 4616d59 commit f340875
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions eth/api_backend.go
Original file line number Diff line number Diff line change
Expand Up @@ -187,6 +187,9 @@ func (b *EthApiBackend) StateAndHeaderByNumber(ctx context.Context, blockNr rpc.
return nil, nil, err
}
stateDb, err := b.eth.BlockChain().StateAt(header.Root)
if err != nil {
return nil, nil, err
}
return stateDb, header, err
}

Expand Down

0 comments on commit f340875

Please sign in to comment.