quick fix for the reconnection issue (#1671)

* Update electrum.dart

* Update electrum.dart

* Duration seconds: 5 [skip ci]
This commit is contained in:
Serhii 2024-09-09 21:08:21 +03:00 committed by GitHub
parent f279a222df
commit 125fdf8b62
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 8 additions and 4 deletions

View file

@ -113,9 +113,13 @@ class ElectrumClient {
}, },
onDone: () { onDone: () {
unterminatedString = ''; unterminatedString = '';
if (host == socket?.address.host) { try {
socket = null; if (host == socket?.address.host) {
_setConnectionStatus(ConnectionStatus.disconnected); socket?.destroy();
_setConnectionStatus(ConnectionStatus.disconnected);
}
} catch(e) {
print(e.toString());
} }
}, },
cancelOnError: true, cancelOnError: true,

View file

@ -2058,7 +2058,7 @@ abstract class ElectrumWalletBase
_isTryingToConnect = true; _isTryingToConnect = true;
Timer(Duration(seconds: 10), () { Timer(Duration(seconds: 5), () {
if (this.syncStatus is NotConnectedSyncStatus || this.syncStatus is LostConnectionSyncStatus) { if (this.syncStatus is NotConnectedSyncStatus || this.syncStatus is LostConnectionSyncStatus) {
this.electrumClient.connectToUri( this.electrumClient.connectToUri(
node!.uri, node!.uri,