port f113904a periodiocPingCheck changes to other electrumx coins

This commit is contained in:
Josh Babb 2023-05-29 11:04:18 -05:00
parent f113904a22
commit 86fabcf9ff
8 changed files with 48 additions and 8 deletions

View file

@ -1072,13 +1072,18 @@ class BitcoinCashWallet extends CoinServiceAPI
void _periodicPingCheck() async {
bool hasNetwork = await testNetworkConnection();
_isConnected = hasNetwork;
if (_isConnected != hasNetwork) {
NodeConnectionStatus status = hasNetwork
? NodeConnectionStatus.connected
: NodeConnectionStatus.disconnected;
GlobalEventBus.instance
.fire(NodeConnectionStatusChangedEvent(status, walletId, coin));
_isConnected = hasNetwork;
if (hasNetwork) {
unawaited(refresh());
}
}
}

View file

@ -1058,13 +1058,18 @@ class DogecoinWallet extends CoinServiceAPI
void _periodicPingCheck() async {
bool hasNetwork = await testNetworkConnection();
_isConnected = hasNetwork;
if (_isConnected != hasNetwork) {
NodeConnectionStatus status = hasNetwork
? NodeConnectionStatus.connected
: NodeConnectionStatus.disconnected;
GlobalEventBus.instance
.fire(NodeConnectionStatusChangedEvent(status, walletId, coin));
_isConnected = hasNetwork;
if (hasNetwork) {
unawaited(refresh());
}
}
}

View file

@ -2679,13 +2679,18 @@ class ECashWallet extends CoinServiceAPI
void _periodicPingCheck() async {
bool hasNetwork = await testNetworkConnection();
_isConnected = hasNetwork;
if (_isConnected != hasNetwork) {
NodeConnectionStatus status = hasNetwork
? NodeConnectionStatus.connected
: NodeConnectionStatus.disconnected;
GlobalEventBus.instance
.fire(NodeConnectionStatusChangedEvent(status, walletId, coin));
_isConnected = hasNetwork;
if (hasNetwork) {
unawaited(refresh());
}
}
}

View file

@ -1620,13 +1620,18 @@ class EpicCashWallet extends CoinServiceAPI
void _periodicPingCheck() async {
bool hasNetwork = await testNetworkConnection();
_isConnected = hasNetwork;
if (_isConnected != hasNetwork) {
NodeConnectionStatus status = hasNetwork
? NodeConnectionStatus.connected
: NodeConnectionStatus.disconnected;
GlobalEventBus.instance
.fire(NodeConnectionStatusChangedEvent(status, walletId, coin));
_isConnected = hasNetwork;
if (hasNetwork) {
unawaited(refresh());
}
}
}

View file

@ -985,13 +985,18 @@ class FiroWallet extends CoinServiceAPI
void _periodicPingCheck() async {
bool hasNetwork = await testNetworkConnection();
_isConnected = hasNetwork;
if (_isConnected != hasNetwork) {
NodeConnectionStatus status = hasNetwork
? NodeConnectionStatus.connected
: NodeConnectionStatus.disconnected;
GlobalEventBus.instance
.fire(NodeConnectionStatusChangedEvent(status, walletId, coin));
_isConnected = hasNetwork;
if (hasNetwork) {
unawaited(refresh());
}
}
}

View file

@ -1189,13 +1189,18 @@ class LitecoinWallet extends CoinServiceAPI
void _periodicPingCheck() async {
bool hasNetwork = await testNetworkConnection();
_isConnected = hasNetwork;
if (_isConnected != hasNetwork) {
NodeConnectionStatus status = hasNetwork
? NodeConnectionStatus.connected
: NodeConnectionStatus.disconnected;
GlobalEventBus.instance
.fire(NodeConnectionStatusChangedEvent(status, walletId, coin));
_isConnected = hasNetwork;
if (hasNetwork) {
unawaited(refresh());
}
}
}

View file

@ -1179,13 +1179,18 @@ class NamecoinWallet extends CoinServiceAPI
void _periodicPingCheck() async {
bool hasNetwork = await testNetworkConnection();
_isConnected = hasNetwork;
if (_isConnected != hasNetwork) {
NodeConnectionStatus status = hasNetwork
? NodeConnectionStatus.connected
: NodeConnectionStatus.disconnected;
GlobalEventBus.instance
.fire(NodeConnectionStatusChangedEvent(status, walletId, coin));
_isConnected = hasNetwork;
if (hasNetwork) {
unawaited(refresh());
}
}
}

View file

@ -1106,13 +1106,18 @@ class ParticlWallet extends CoinServiceAPI
void _periodicPingCheck() async {
bool hasNetwork = await testNetworkConnection();
_isConnected = hasNetwork;
if (_isConnected != hasNetwork) {
NodeConnectionStatus status = hasNetwork
? NodeConnectionStatus.connected
: NodeConnectionStatus.disconnected;
GlobalEventBus.instance
.fire(NodeConnectionStatusChangedEvent(status, walletId, coin));
_isConnected = hasNetwork;
if (hasNetwork) {
unawaited(refresh());
}
}
}