trie, rpc, cmd/geth: fix tests on 32-bit and windows + minor rpc fixes (#21871)
* trie: fix tests to work on 32-bit systems * les: make test work on 32-bit platform * cmd/geth: fix windows-issues on tests * trie: improve balance * cmd/geth: make account tests less verbose + less mem intense * rpc: make debug-level log output less verbose * cmd/geth: lint
This commit is contained in:
committed by
GitHub
parent
f1e1d9f874
commit
6f88d6530a
@ -18,6 +18,7 @@ package rpc
|
||||
|
||||
import (
|
||||
"net"
|
||||
"strings"
|
||||
|
||||
"github.com/ethereum/go-ethereum/log"
|
||||
)
|
||||
@ -25,13 +26,22 @@ import (
|
||||
// StartIPCEndpoint starts an IPC endpoint.
|
||||
func StartIPCEndpoint(ipcEndpoint string, apis []API) (net.Listener, *Server, error) {
|
||||
// Register all the APIs exposed by the services.
|
||||
handler := NewServer()
|
||||
var (
|
||||
handler = NewServer()
|
||||
regMap = make(map[string]struct{})
|
||||
registered []string
|
||||
)
|
||||
for _, api := range apis {
|
||||
if err := handler.RegisterName(api.Namespace, api.Service); err != nil {
|
||||
log.Info("IPC registration failed", "namespace", api.Namespace, "error", err)
|
||||
return nil, nil, err
|
||||
}
|
||||
log.Debug("IPC registered", "namespace", api.Namespace)
|
||||
if _, ok := regMap[api.Namespace]; !ok {
|
||||
registered = append(registered, api.Namespace)
|
||||
regMap[api.Namespace] = struct{}{}
|
||||
}
|
||||
}
|
||||
log.Debug("IPCs registered", "namespaces", strings.Join(registered, ","))
|
||||
// All APIs registered, start the IPC listener.
|
||||
listener, err := ipcListen(ipcEndpoint)
|
||||
if err != nil {
|
||||
|
Reference in New Issue
Block a user