mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-08-20 10:52:25 +00:00
fixed some TODOs
This commit is contained in:
parent
62bb958471
commit
fdff70c14c
4 changed files with 3 additions and 5 deletions
|
|
@ -848,7 +848,7 @@ func splitAndTrim(input string) []string {
|
||||||
return result
|
return result
|
||||||
}
|
}
|
||||||
|
|
||||||
func retesteth(ctx *cli.Context) error { // TODO uncomment and fix test
|
func retesteth(ctx *cli.Context) error {
|
||||||
log.Info("Welcome to retesteth!")
|
log.Info("Welcome to retesteth!")
|
||||||
// register signer API with server
|
// register signer API with server
|
||||||
var (
|
var (
|
||||||
|
|
|
||||||
|
|
@ -372,12 +372,12 @@ func (n *Node) startHTTP(endpoint string, apis []rpc.API, modules []string, cors
|
||||||
|
|
||||||
srv := rpc.NewServer()
|
srv := rpc.NewServer()
|
||||||
|
|
||||||
// TODO put this stuff in a separate function
|
|
||||||
// Generate the whitelist based on the allowed modules
|
// Generate the whitelist based on the allowed modules
|
||||||
whitelist := make(map[string]bool)
|
whitelist := make(map[string]bool)
|
||||||
for _, module := range modules {
|
for _, module := range modules {
|
||||||
whitelist[module] = true
|
whitelist[module] = true
|
||||||
}
|
}
|
||||||
|
|
||||||
// Register all the APIs exposed by the services
|
// Register all the APIs exposed by the services
|
||||||
for _, api := range apis {
|
for _, api := range apis {
|
||||||
if whitelist[api.Namespace] || (len(whitelist) == 0 && api.Public) {
|
if whitelist[api.Namespace] || (len(whitelist) == 0 && api.Public) {
|
||||||
|
|
|
||||||
|
|
@ -58,7 +58,6 @@ func StartHTTPEndpoint(endpoint string, apis []API, modules []string, timeouts H
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
|
|
||||||
// TODO put timeout registration in separate function
|
|
||||||
// Make sure timeout values are meaningful
|
// Make sure timeout values are meaningful
|
||||||
if timeouts.ReadTimeout < time.Second {
|
if timeouts.ReadTimeout < time.Second {
|
||||||
log.Warn("Sanitizing invalid HTTP read timeout", "provided", timeouts.ReadTimeout, "updated", DefaultHTTPTimeouts.ReadTimeout)
|
log.Warn("Sanitizing invalid HTTP read timeout", "provided", timeouts.ReadTimeout, "updated", DefaultHTTPTimeouts.ReadTimeout)
|
||||||
|
|
@ -82,7 +81,6 @@ func StartHTTPEndpoint(endpoint string, apis []API, modules []string, timeouts H
|
||||||
}
|
}
|
||||||
|
|
||||||
go httpSrv.Serve(listener)
|
go httpSrv.Serve(listener)
|
||||||
// go NewHTTPServer(cors, vhosts, timeouts, handler, handler.WebsocketHandler(wsOrigins)).Serve(listener) // TODO REMOVE
|
|
||||||
return listener, err
|
return listener, err
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -298,7 +298,7 @@ func validateRequest(r *http.Request) (int, error) {
|
||||||
return http.StatusUnsupportedMediaType, err
|
return http.StatusUnsupportedMediaType, err
|
||||||
}
|
}
|
||||||
|
|
||||||
// NewHTTPHandlerStack TODO document
|
// NewHTTPHandlerStack returns wrapped http-related handlers
|
||||||
func NewHTTPHandlerStack(srv *Server, cors []string, vhosts []string) http.Handler {
|
func NewHTTPHandlerStack(srv *Server, cors []string, vhosts []string) http.Handler {
|
||||||
// Wrap the CORS-handler within a host-handler
|
// Wrap the CORS-handler within a host-handler
|
||||||
handler := newCorsHandler(srv, cors)
|
handler := newCorsHandler(srv, cors)
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue