mirror of
https://github.com/cake-tech/cake_wallet.git
synced 2025-06-28 12:29:51 +00:00
minor fix [skip ci]
This commit is contained in:
parent
14549bcfe2
commit
c0283a37ee
1 changed files with 11 additions and 7 deletions
|
@ -710,14 +710,18 @@ abstract class DecredWalletBase
|
||||||
// walletBirthdayBlockHeight checks if the wallet birthday is set and returns
|
// walletBirthdayBlockHeight checks if the wallet birthday is set and returns
|
||||||
// it. Returns -1 if not.
|
// it. Returns -1 if not.
|
||||||
Future<int> walletBirthdayBlockHeight() async {
|
Future<int> walletBirthdayBlockHeight() async {
|
||||||
final res = await _libwallet.birthState(walletInfo.name);
|
try {
|
||||||
final decoded = json.decode(res);
|
final res = await _libwallet.birthState(walletInfo.name);
|
||||||
// Having these values set indicates that sync has not reached the birthday
|
final decoded = json.decode(res);
|
||||||
// yet, so no birthday is set.
|
// Having these values set indicates that sync has not reached the birthday
|
||||||
if (decoded["setfromheight"] == true || decoded["setfromtime"] == true) {
|
// yet, so no birthday is set.
|
||||||
return -1;
|
if (decoded["setfromheight"] == true || decoded["setfromtime"] == true) {
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
return decoded["height"] ?? 0;
|
||||||
|
} on FormatException catch (_) {
|
||||||
|
return 0;
|
||||||
}
|
}
|
||||||
return decoded["height"] ?? 0;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
Future<bool> verifyMessage(String message, String signature, {String? address = null}) async {
|
Future<bool> verifyMessage(String message, String signature, {String? address = null}) async {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue