diff --git a/electrum/daemon.py b/electrum/daemon.py index b0087a5ac..6c26d6b7e 100644 --- a/electrum/daemon.py +++ b/electrum/daemon.py @@ -65,7 +65,9 @@ class DaemonNotRunning(Exception): def get_rpcsock_defaultpath(config: SimpleConfig): return os.path.join(config.path, 'daemon_rpc_socket') -def get_rpcsock_default_type(): +def get_rpcsock_default_type(config: SimpleConfig): + if config.get('rpchost') and config.get('rpcport'): + return 'tcp' # Use unix domain sockets when available, # with the extra paranoia that in case windows "implements" them, # we want to test it before making it the default there. @@ -251,7 +253,7 @@ class CommandsServer(AuthenticatedServer): self.fd = fd self.config = daemon.config sockettype = self.config.get('rpcsock', 'auto') - self.socktype = sockettype if sockettype != 'auto' else get_rpcsock_default_type() + self.socktype = sockettype if sockettype != 'auto' else get_rpcsock_default_type(self.config) self.sockpath = self.config.get('rpcsockpath', get_rpcsock_defaultpath(self.config)) self.host = self.config.get('rpchost', '127.0.0.1') self.port = self.config.get('rpcport', 0)