Merge pull request #2884 from nspcc-dev/refactor/rpcsrv-error-channel

services/rpcsrv: Strengthen `Server` error channel's type
This commit is contained in:
Roman Khimov 2023-01-23 19:04:58 +07:00 committed by GitHub
commit 1262a27065
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -133,7 +133,7 @@ type (
log *zap.Logger log *zap.Logger
shutdown chan struct{} shutdown chan struct{}
started *atomic.Bool started *atomic.Bool
errChan chan error errChan chan<- error
sessionsLock sync.Mutex sessionsLock sync.Mutex
sessions map[string]*session sessions map[string]*session
@ -255,7 +255,7 @@ var invalidBlockHeightError = func(index int, height int) *neorpc.Error {
// New creates a new Server struct. // New creates a new Server struct.
func New(chain Ledger, conf config.RPC, coreServer *network.Server, func New(chain Ledger, conf config.RPC, coreServer *network.Server,
orc OracleHandler, log *zap.Logger, errChan chan error) Server { orc OracleHandler, log *zap.Logger, errChan chan<- error) Server {
addrs := conf.GetAddresses() addrs := conf.GetAddresses()
httpServers := make([]*http.Server, len(addrs)) httpServers := make([]*http.Server, len(addrs))
for i, addr := range addrs { for i, addr := range addrs {