mirror of
https://github.com/BlueWallet/BlueWallet.git
synced 2025-01-19 05:45:15 +01:00
FIX: Connect to the same electrum server as the app.
This commit is contained in:
parent
ae2380e132
commit
c986c557ac
@ -44,6 +44,17 @@ async function connectMain() {
|
||||
usingPeer = savedPeer;
|
||||
}
|
||||
|
||||
try {
|
||||
await DefaultPreference.setName('group.io.bluewallet.bluewallet');
|
||||
await DefaultPreference.set(AppStorage.ELECTRUM_HOST, usingPeer.host);
|
||||
await DefaultPreference.set(AppStorage.ELECTRUM_TCP_PORT, usingPeer.tcp);
|
||||
await DefaultPreference.set(AppStorage.ELECTRUM_SSL_PORT, usingPeer.ssl);
|
||||
RNWidgetCenter.reloadAllTimelines();
|
||||
} catch (e) {
|
||||
// Must be running on Android
|
||||
console.log(e);
|
||||
}
|
||||
|
||||
try {
|
||||
console.log('begin connection:', JSON.stringify(usingPeer));
|
||||
mainClient = new ElectrumClient(usingPeer.ssl || usingPeer.tcp, usingPeer.host, usingPeer.ssl ? 'tls' : 'tcp');
|
||||
@ -105,17 +116,6 @@ async function getSavedPeer() {
|
||||
const host = await AsyncStorage.getItem(AppStorage.ELECTRUM_HOST);
|
||||
const port = await AsyncStorage.getItem(AppStorage.ELECTRUM_TCP_PORT);
|
||||
const sslPort = await AsyncStorage.getItem(AppStorage.ELECTRUM_SSL_PORT);
|
||||
try {
|
||||
await DefaultPreference.setName('group.io.bluewallet.bluewallet');
|
||||
await DefaultPreference.set(AppStorage.ELECTRUM_HOST, host);
|
||||
await DefaultPreference.set(AppStorage.ELECTRUM_TCP_PORT, port);
|
||||
await DefaultPreference.set(AppStorage.ELECTRUM_SSL_PORT, sslPort);
|
||||
RNWidgetCenter.reloadAllTimelines();
|
||||
} catch (e) {
|
||||
// Must be running on Android
|
||||
console.log(e);
|
||||
}
|
||||
|
||||
return { host, tcp: port, ssl: sslPort };
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user