mirror of
https://github.com/btcsuite/btcd.git
synced 2025-01-19 05:33:36 +01:00
Don't fail RPC server create due to single iface.
Rather than returning an error when creating the RPC server an it can't listen on any of the specified interfaces, only error when it can't listen on all of the specified interfaces.
This commit is contained in:
parent
eecea4180a
commit
9d6dd6fa6b
@ -368,8 +368,7 @@ func newRPCServer(listenAddrs []string, s *server) (*rpcServer, error) {
|
||||
listeners := make([]net.Listener, 0,
|
||||
len(ipv6ListenAddrs)+len(ipv4ListenAddrs))
|
||||
for _, addr := range ipv4ListenAddrs {
|
||||
var listener net.Listener
|
||||
listener, err = tls.Listen("tcp4", addr, &tlsConfig)
|
||||
listener, err := tls.Listen("tcp4", addr, &tlsConfig)
|
||||
if err != nil {
|
||||
rpcsLog.Warnf("Can't listen on %s: %v", addr,
|
||||
err)
|
||||
@ -379,8 +378,7 @@ func newRPCServer(listenAddrs []string, s *server) (*rpcServer, error) {
|
||||
}
|
||||
|
||||
for _, addr := range ipv6ListenAddrs {
|
||||
var listener net.Listener
|
||||
listener, err = tls.Listen("tcp6", addr, &tlsConfig)
|
||||
listener, err := tls.Listen("tcp6", addr, &tlsConfig)
|
||||
if err != nil {
|
||||
rpcsLog.Warnf("Can't listen on %s: %v", addr,
|
||||
err)
|
||||
@ -394,7 +392,7 @@ func newRPCServer(listenAddrs []string, s *server) (*rpcServer, error) {
|
||||
|
||||
rpc.listeners = listeners
|
||||
|
||||
return &rpc, err
|
||||
return &rpc, nil
|
||||
}
|
||||
|
||||
// jsonAuthFail sends a message back to the client if the http auth is rejected.
|
||||
|
Loading…
Reference in New Issue
Block a user