From 7296f49b3f1f35bc382f94d68f98b7e9a740f2f9 Mon Sep 17 00:00:00 2001 From: meows Date: Tue, 14 Jan 2020 09:23:23 -0600 Subject: [PATCH] rpc: name function and fix comment Function renamed from is_ to check_ to avoid the convention of is_ functions returning bools. Signed-off-by: meows --- rpc/endpoints.go | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/rpc/endpoints.go b/rpc/endpoints.go index 79886eb0dc..e734f0c880 100644 --- a/rpc/endpoints.go +++ b/rpc/endpoints.go @@ -23,11 +23,11 @@ import ( "github.com/ethereum/go-ethereum/log" ) -// isModuleAvailable enforces that requested api modules (eg. via --rpcapi) are actually +// checkModuleAvailable check that requested api modules (eg. via --rpcapi) are actually // available API services. If an invalid module is given (ie API "foo" wanted which does not exist), -// then log.Crit is used to cause program to exit, logging the invalid module and a list of available +// then an error is returned including the invalid module and a list of available // API service names. -func isModuleAvailable(module string, apis []API) (err error) { +func checkModuleAvailable(module string, apis []API) (err error) { for _, api := range apis { if module == api.Namespace { return nil @@ -57,7 +57,7 @@ func StartHTTPEndpoint(endpoint string, apis []API, modules []string, cors []str for _, module := range modules { // Ensure the requested module is actually available. - if err := isModuleAvailable(module, apis); err != nil { + if err := checkModuleAvailable(module, apis); err != nil { return nil, nil, err } whitelist[module] = true @@ -92,7 +92,7 @@ func StartWSEndpoint(endpoint string, apis []API, modules []string, wsOrigins [] for _, module := range modules { // Ensure the requested module is actually available. - if err := isModuleAvailable(module, apis); err != nil { + if err := checkModuleAvailable(module, apis); err != nil { return nil, nil, err } whitelist[module] = true