mirror of
https://github.com/cake-tech/cake_wallet.git
synced 2025-01-11 13:24:51 +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");
|
||||
}
|
||||
|
||||
if (_publicAddress == null) {
|
||||
await Future.delayed(Duration(seconds: 1));
|
||||
}
|
||||
|
||||
try {
|
||||
await _updateBalance();
|
||||
await _updateRep();
|
||||
await _receiveAll();
|
||||
} catch (e) {}
|
||||
} catch (e) {
|
||||
print(e);
|
||||
}
|
||||
|
||||
syncStatus = ConnectedSyncStatus();
|
||||
} catch (e) {
|
||||
|
@ -349,7 +355,12 @@ abstract class NanoWalletBase
|
|||
Future<void> _updateRep() async {
|
||||
try {
|
||||
final accountInfo = await _client.getAccountInfo(_publicAddress!);
|
||||
_representativeAddress = accountInfo["representative"] as String;
|
||||
if (accountInfo["error"] != null) {
|
||||
// account not found:
|
||||
_representativeAddress = NanoClient.DEFAULT_REPRESENTATIVE;
|
||||
} else {
|
||||
_representativeAddress = accountInfo["representative"] as String;
|
||||
}
|
||||
} catch (e) {
|
||||
throw Exception("Failed to get representative address $e");
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue