mirror of
https://github.com/cypherstack/stack_wallet.git
synced 2024-11-17 01:37:54 +00:00
remove unnecessary try-catch
This commit is contained in:
parent
66354e8ecd
commit
0f665bd602
1 changed files with 16 additions and 20 deletions
|
@ -114,29 +114,25 @@ class SubscribableElectrumXClient {
|
||||||
);
|
);
|
||||||
|
|
||||||
// Listen to global event bus for Tor preference changes.
|
// Listen to global event bus for Tor preference changes.
|
||||||
try {
|
_torPreferenceListener = bus.on<TorPreferenceChangedEvent>().listen(
|
||||||
_torPreferenceListener = bus.on<TorPreferenceChangedEvent>().listen(
|
(event) async {
|
||||||
(event) async {
|
// Close open socket (if open).
|
||||||
// Close open socket (if open).
|
final tempSocket = _socket;
|
||||||
final tempSocket = _socket;
|
_socket = null;
|
||||||
_socket = null;
|
await tempSocket?.close();
|
||||||
await tempSocket?.close();
|
|
||||||
|
|
||||||
// Close open SOCKS socket (if open).
|
// Close open SOCKS socket (if open).
|
||||||
final tempSOCKSSocket = _socksSocket;
|
final tempSOCKSSocket = _socksSocket;
|
||||||
_socksSocket = null;
|
_socksSocket = null;
|
||||||
await tempSOCKSSocket?.close();
|
await tempSOCKSSocket?.close();
|
||||||
|
|
||||||
// Clear subscriptions.
|
// Clear subscriptions.
|
||||||
_tasks.clear();
|
_tasks.clear();
|
||||||
|
|
||||||
// Cancel alive timer
|
// Cancel alive timer
|
||||||
_aliveTimer?.cancel();
|
_aliveTimer?.cancel();
|
||||||
},
|
},
|
||||||
);
|
);
|
||||||
} catch (e, s) {
|
|
||||||
print(s);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
factory SubscribableElectrumXClient.from({
|
factory SubscribableElectrumXClient.from({
|
||||||
|
|
Loading…
Reference in a new issue