mirror of
https://github.com/cypherstack/stack_wallet.git
synced 2025-01-09 20:29:57 +00:00
port f113904a
periodiocPingCheck changes to other electrumx coins
This commit is contained in:
parent
f113904a22
commit
86fabcf9ff
8 changed files with 48 additions and 8 deletions
|
@ -1072,13 +1072,18 @@ class BitcoinCashWallet extends CoinServiceAPI
|
||||||
|
|
||||||
void _periodicPingCheck() async {
|
void _periodicPingCheck() async {
|
||||||
bool hasNetwork = await testNetworkConnection();
|
bool hasNetwork = await testNetworkConnection();
|
||||||
_isConnected = hasNetwork;
|
|
||||||
if (_isConnected != hasNetwork) {
|
if (_isConnected != hasNetwork) {
|
||||||
NodeConnectionStatus status = hasNetwork
|
NodeConnectionStatus status = hasNetwork
|
||||||
? NodeConnectionStatus.connected
|
? NodeConnectionStatus.connected
|
||||||
: NodeConnectionStatus.disconnected;
|
: NodeConnectionStatus.disconnected;
|
||||||
GlobalEventBus.instance
|
GlobalEventBus.instance
|
||||||
.fire(NodeConnectionStatusChangedEvent(status, walletId, coin));
|
.fire(NodeConnectionStatusChangedEvent(status, walletId, coin));
|
||||||
|
|
||||||
|
_isConnected = hasNetwork;
|
||||||
|
if (hasNetwork) {
|
||||||
|
unawaited(refresh());
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -1058,13 +1058,18 @@ class DogecoinWallet extends CoinServiceAPI
|
||||||
|
|
||||||
void _periodicPingCheck() async {
|
void _periodicPingCheck() async {
|
||||||
bool hasNetwork = await testNetworkConnection();
|
bool hasNetwork = await testNetworkConnection();
|
||||||
_isConnected = hasNetwork;
|
|
||||||
if (_isConnected != hasNetwork) {
|
if (_isConnected != hasNetwork) {
|
||||||
NodeConnectionStatus status = hasNetwork
|
NodeConnectionStatus status = hasNetwork
|
||||||
? NodeConnectionStatus.connected
|
? NodeConnectionStatus.connected
|
||||||
: NodeConnectionStatus.disconnected;
|
: NodeConnectionStatus.disconnected;
|
||||||
GlobalEventBus.instance
|
GlobalEventBus.instance
|
||||||
.fire(NodeConnectionStatusChangedEvent(status, walletId, coin));
|
.fire(NodeConnectionStatusChangedEvent(status, walletId, coin));
|
||||||
|
|
||||||
|
_isConnected = hasNetwork;
|
||||||
|
if (hasNetwork) {
|
||||||
|
unawaited(refresh());
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -2679,13 +2679,18 @@ class ECashWallet extends CoinServiceAPI
|
||||||
|
|
||||||
void _periodicPingCheck() async {
|
void _periodicPingCheck() async {
|
||||||
bool hasNetwork = await testNetworkConnection();
|
bool hasNetwork = await testNetworkConnection();
|
||||||
_isConnected = hasNetwork;
|
|
||||||
if (_isConnected != hasNetwork) {
|
if (_isConnected != hasNetwork) {
|
||||||
NodeConnectionStatus status = hasNetwork
|
NodeConnectionStatus status = hasNetwork
|
||||||
? NodeConnectionStatus.connected
|
? NodeConnectionStatus.connected
|
||||||
: NodeConnectionStatus.disconnected;
|
: NodeConnectionStatus.disconnected;
|
||||||
GlobalEventBus.instance
|
GlobalEventBus.instance
|
||||||
.fire(NodeConnectionStatusChangedEvent(status, walletId, coin));
|
.fire(NodeConnectionStatusChangedEvent(status, walletId, coin));
|
||||||
|
|
||||||
|
_isConnected = hasNetwork;
|
||||||
|
if (hasNetwork) {
|
||||||
|
unawaited(refresh());
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -1620,13 +1620,18 @@ class EpicCashWallet extends CoinServiceAPI
|
||||||
|
|
||||||
void _periodicPingCheck() async {
|
void _periodicPingCheck() async {
|
||||||
bool hasNetwork = await testNetworkConnection();
|
bool hasNetwork = await testNetworkConnection();
|
||||||
_isConnected = hasNetwork;
|
|
||||||
if (_isConnected != hasNetwork) {
|
if (_isConnected != hasNetwork) {
|
||||||
NodeConnectionStatus status = hasNetwork
|
NodeConnectionStatus status = hasNetwork
|
||||||
? NodeConnectionStatus.connected
|
? NodeConnectionStatus.connected
|
||||||
: NodeConnectionStatus.disconnected;
|
: NodeConnectionStatus.disconnected;
|
||||||
GlobalEventBus.instance
|
GlobalEventBus.instance
|
||||||
.fire(NodeConnectionStatusChangedEvent(status, walletId, coin));
|
.fire(NodeConnectionStatusChangedEvent(status, walletId, coin));
|
||||||
|
|
||||||
|
_isConnected = hasNetwork;
|
||||||
|
if (hasNetwork) {
|
||||||
|
unawaited(refresh());
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -985,13 +985,18 @@ class FiroWallet extends CoinServiceAPI
|
||||||
|
|
||||||
void _periodicPingCheck() async {
|
void _periodicPingCheck() async {
|
||||||
bool hasNetwork = await testNetworkConnection();
|
bool hasNetwork = await testNetworkConnection();
|
||||||
_isConnected = hasNetwork;
|
|
||||||
if (_isConnected != hasNetwork) {
|
if (_isConnected != hasNetwork) {
|
||||||
NodeConnectionStatus status = hasNetwork
|
NodeConnectionStatus status = hasNetwork
|
||||||
? NodeConnectionStatus.connected
|
? NodeConnectionStatus.connected
|
||||||
: NodeConnectionStatus.disconnected;
|
: NodeConnectionStatus.disconnected;
|
||||||
GlobalEventBus.instance
|
GlobalEventBus.instance
|
||||||
.fire(NodeConnectionStatusChangedEvent(status, walletId, coin));
|
.fire(NodeConnectionStatusChangedEvent(status, walletId, coin));
|
||||||
|
|
||||||
|
_isConnected = hasNetwork;
|
||||||
|
if (hasNetwork) {
|
||||||
|
unawaited(refresh());
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -1189,13 +1189,18 @@ class LitecoinWallet extends CoinServiceAPI
|
||||||
|
|
||||||
void _periodicPingCheck() async {
|
void _periodicPingCheck() async {
|
||||||
bool hasNetwork = await testNetworkConnection();
|
bool hasNetwork = await testNetworkConnection();
|
||||||
_isConnected = hasNetwork;
|
|
||||||
if (_isConnected != hasNetwork) {
|
if (_isConnected != hasNetwork) {
|
||||||
NodeConnectionStatus status = hasNetwork
|
NodeConnectionStatus status = hasNetwork
|
||||||
? NodeConnectionStatus.connected
|
? NodeConnectionStatus.connected
|
||||||
: NodeConnectionStatus.disconnected;
|
: NodeConnectionStatus.disconnected;
|
||||||
GlobalEventBus.instance
|
GlobalEventBus.instance
|
||||||
.fire(NodeConnectionStatusChangedEvent(status, walletId, coin));
|
.fire(NodeConnectionStatusChangedEvent(status, walletId, coin));
|
||||||
|
|
||||||
|
_isConnected = hasNetwork;
|
||||||
|
if (hasNetwork) {
|
||||||
|
unawaited(refresh());
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -1179,13 +1179,18 @@ class NamecoinWallet extends CoinServiceAPI
|
||||||
|
|
||||||
void _periodicPingCheck() async {
|
void _periodicPingCheck() async {
|
||||||
bool hasNetwork = await testNetworkConnection();
|
bool hasNetwork = await testNetworkConnection();
|
||||||
_isConnected = hasNetwork;
|
|
||||||
if (_isConnected != hasNetwork) {
|
if (_isConnected != hasNetwork) {
|
||||||
NodeConnectionStatus status = hasNetwork
|
NodeConnectionStatus status = hasNetwork
|
||||||
? NodeConnectionStatus.connected
|
? NodeConnectionStatus.connected
|
||||||
: NodeConnectionStatus.disconnected;
|
: NodeConnectionStatus.disconnected;
|
||||||
GlobalEventBus.instance
|
GlobalEventBus.instance
|
||||||
.fire(NodeConnectionStatusChangedEvent(status, walletId, coin));
|
.fire(NodeConnectionStatusChangedEvent(status, walletId, coin));
|
||||||
|
|
||||||
|
_isConnected = hasNetwork;
|
||||||
|
if (hasNetwork) {
|
||||||
|
unawaited(refresh());
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -1106,13 +1106,18 @@ class ParticlWallet extends CoinServiceAPI
|
||||||
|
|
||||||
void _periodicPingCheck() async {
|
void _periodicPingCheck() async {
|
||||||
bool hasNetwork = await testNetworkConnection();
|
bool hasNetwork = await testNetworkConnection();
|
||||||
_isConnected = hasNetwork;
|
|
||||||
if (_isConnected != hasNetwork) {
|
if (_isConnected != hasNetwork) {
|
||||||
NodeConnectionStatus status = hasNetwork
|
NodeConnectionStatus status = hasNetwork
|
||||||
? NodeConnectionStatus.connected
|
? NodeConnectionStatus.connected
|
||||||
: NodeConnectionStatus.disconnected;
|
: NodeConnectionStatus.disconnected;
|
||||||
GlobalEventBus.instance
|
GlobalEventBus.instance
|
||||||
.fire(NodeConnectionStatusChangedEvent(status, walletId, coin));
|
.fire(NodeConnectionStatusChangedEvent(status, walletId, coin));
|
||||||
|
|
||||||
|
_isConnected = hasNetwork;
|
||||||
|
if (hasNetwork) {
|
||||||
|
unawaited(refresh());
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue