Skip to content

Commit 2ad76c6

Browse files
committed
rpc: dont log an error if user configures --rpcapi=rpc... (ethereum#20776)
1 parent 8f6a2af commit 2ad76c6

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

rpc/endpoints.go

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,9 @@ import (
2323
"github.com/XinFinOrg/XDPoSChain/log"
2424
)
2525

26-
// checkModuleAvailability check that all names given in modules are actually
27-
// available API services.
26+
// checkModuleAvailability checks that all names given in modules are actually
27+
// available API services. It assumes that the MetadataApi module ("rpc") is always available;
28+
// the registration of this "rpc" module happens in NewServer() and is thus common to all endpoints.
2829
func checkModuleAvailability(modules []string, apis []API) (bad, available []string) {
2930
availableSet := make(map[string]struct{})
3031
for _, api := range apis {
@@ -34,7 +35,7 @@ func checkModuleAvailability(modules []string, apis []API) (bad, available []str
3435
}
3536
}
3637
for _, name := range modules {
37-
if _, ok := availableSet[name]; !ok {
38+
if _, ok := availableSet[name]; !ok && name != MetadataApi {
3839
bad = append(bad, name)
3940
}
4041
}

0 commit comments

Comments
 (0)