mirror of
https://github.com/cake-tech/cake_wallet.git
synced 2025-01-25 20:16:05 +00:00
save
This commit is contained in:
parent
5875051ace
commit
27777d4918
1 changed files with 13 additions and 2 deletions
|
@ -119,11 +119,17 @@ abstract class NanoWalletBase
|
||||||
throw Exception("Nano Node connection failed");
|
throw Exception("Nano Node connection failed");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (_publicAddress == null) {
|
||||||
|
await Future.delayed(Duration(seconds: 1));
|
||||||
|
}
|
||||||
|
|
||||||
try {
|
try {
|
||||||
await _updateBalance();
|
await _updateBalance();
|
||||||
await _updateRep();
|
await _updateRep();
|
||||||
await _receiveAll();
|
await _receiveAll();
|
||||||
} catch (e) {}
|
} catch (e) {
|
||||||
|
print(e);
|
||||||
|
}
|
||||||
|
|
||||||
syncStatus = ConnectedSyncStatus();
|
syncStatus = ConnectedSyncStatus();
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
|
@ -349,7 +355,12 @@ abstract class NanoWalletBase
|
||||||
Future<void> _updateRep() async {
|
Future<void> _updateRep() async {
|
||||||
try {
|
try {
|
||||||
final accountInfo = await _client.getAccountInfo(_publicAddress!);
|
final accountInfo = await _client.getAccountInfo(_publicAddress!);
|
||||||
|
if (accountInfo["error"] != null) {
|
||||||
|
// account not found:
|
||||||
|
_representativeAddress = NanoClient.DEFAULT_REPRESENTATIVE;
|
||||||
|
} else {
|
||||||
_representativeAddress = accountInfo["representative"] as String;
|
_representativeAddress = accountInfo["representative"] as String;
|
||||||
|
}
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
throw Exception("Failed to get representative address $e");
|
throw Exception("Failed to get representative address $e");
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue