From 6cf13c5e7662c75716ea3f711c34838e73f333f9 Mon Sep 17 00:00:00 2001 From: meows Date: Tue, 17 Mar 2020 15:59:26 -0500 Subject: [PATCH 1/2] rpc: dont log an error if user configures --rpcapi=rpc... Signed-off-by: meows --- rpc/endpoints.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/rpc/endpoints.go b/rpc/endpoints.go index ed295adfc0d3..540c5b77137e 100644 --- a/rpc/endpoints.go +++ b/rpc/endpoints.go @@ -23,7 +23,7 @@ import ( ) // checkModuleAvailability check that all names given in modules are actually -// available API services. +// available API services. It assumes that the special snowflake "rpc" module is always available. func checkModuleAvailability(modules []string, apis []API) (bad, available []string) { availableSet := make(map[string]struct{}) for _, api := range apis { @@ -33,7 +33,7 @@ func checkModuleAvailability(modules []string, apis []API) (bad, available []str } } for _, name := range modules { - if _, ok := availableSet[name]; !ok { + if _, ok := availableSet[name]; !ok && name != MetadataApi { bad = append(bad, name) } } From bb73be873f760331bbb824a52d11545809f64302 Mon Sep 17 00:00:00 2001 From: meows Date: Fri, 20 Mar 2020 06:59:04 -0500 Subject: [PATCH 2/2] rpc: make comment more informative and neutral Signed-off-by: meows --- rpc/endpoints.go | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/rpc/endpoints.go b/rpc/endpoints.go index 540c5b77137e..09f389d71bc8 100644 --- a/rpc/endpoints.go +++ b/rpc/endpoints.go @@ -22,8 +22,9 @@ import ( "github.com/ethereum/go-ethereum/log" ) -// checkModuleAvailability check that all names given in modules are actually -// available API services. It assumes that the special snowflake "rpc" module is always available. +// checkModuleAvailability checks that all names given in modules are actually +// available API services. It assumes that the MetadataApi module ("rpc") is always available; +// the registration of this "rpc" module happens in NewServer() and is thus common to all endpoints. func checkModuleAvailability(modules []string, apis []API) (bad, available []string) { availableSet := make(map[string]struct{}) for _, api := range apis {