From 45a059b9e794aec4bb9fdaf13c5ac945a645fe64 Mon Sep 17 00:00:00 2001 From: Kevin Mulcrone Date: Tue, 6 Dec 2022 07:52:15 -0700 Subject: [PATCH] fix(Electron): default electrum endpoint see Lily-Technologies/lily-wallet#115 --- apps/electron/src/main.ts | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/apps/electron/src/main.ts b/apps/electron/src/main.ts index ede4e979..7cb3447c 100644 --- a/apps/electron/src/main.ts +++ b/apps/electron/src/main.ts @@ -189,17 +189,21 @@ const setupInitialNodeConfig = async () => { } } catch (e) { console.log('Failed to connect to local Bitcoin Core instance.'); - const defaultElectrumEndpoint = 'electrum.emzy.de'; + const defaultElectrumEndpoint = 'electrum1.bluewallet.io'; try { console.log(`Connecting to ${defaultElectrumEndpoint}...`); OnchainDataProvider = new ElectrumProvider( defaultElectrumEndpoint, - 50002, + 50001, 'tcp', isTestnet ); await OnchainDataProvider.initialize(); - console.log(`Connected to ${defaultElectrumEndpoint}`); + if (OnchainDataProvider.connected) { + console.log(`Connected to ${defaultElectrumEndpoint}`); + } else { + throw new Error(); // throw error to go to catch segment + } } catch (e) { console.log(`Failed to connect to ${defaultElectrumEndpoint}`); const defaultEsploraEndpoint = 'https://blockstream.info';