Skip to content

Commit 93ffb85

Browse files
authored
rpc: dont log an error if user configures --rpcapi=rpc... (#20776)
This just prevents a false negative ERROR warning when, for some unknown reason, a user attempts to turn on the module rpc even though it's already going to be on.
1 parent e943f07 commit 93ffb85

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
@@ -22,8 +22,9 @@ import (
2222
"github.com/ethereum/go-ethereum/log"
2323
)
2424

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

0 commit comments

Comments
 (0)