Skip to content

Commit

Permalink
fix(Electron): default electrum endpoint
Browse files Browse the repository at this point in the history
see #115
  • Loading branch information
KayBeSee committed Dec 6, 2022
1 parent f32f7b9 commit 45a059b
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions apps/electron/src/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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';
Expand Down

0 comments on commit 45a059b

Please sign in to comment.