From 93da858f5c616347a9e48a2128089a1cc7cdb778 Mon Sep 17 00:00:00 2001 From: binarybaron <86064887+binarybaron@users.noreply.github.com> Date: Mon, 10 Jun 2024 20:22:18 +0200 Subject: [PATCH] feat: Start Tor at startup (if no stub testnet provider is present) --- src/main/main.ts | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/main/main.ts b/src/main/main.ts index a4a02ef..3f0bc3b 100644 --- a/src/main/main.ts +++ b/src/main/main.ts @@ -19,7 +19,6 @@ import { } from 'store/config'; import { resolveHtmlPath } from './util'; import { startRPC, stopCli } from './cli/cli'; -import { getPlatform, isDevelopment, isTestnet } from 'store/config'; import getSavedLogsOfSwapId, { getAssetPath, fixAppDataPath } from './cli/dirs'; import initSocket from './socket'; import logger from '../utils/logger'; @@ -135,6 +134,12 @@ if (gotTheLock) { initSocket(); await startRPC(); + // Don't spawn Tor if we have a stub testnet provider + // It's most likely gonna be a local one and we cannot build Tor circuits to it + if (getStubTestnetProvider() != null) { + await spawnTor(); + } + return 0; }) .catch((e) =>