mirror of
https://github.com/cypherstack/stack_wallet.git
synced 2024-11-18 02:07:43 +00:00
Merge pull request #753 from cypherstack/refresh-sync-issues
Address several refresh/sync issues
This commit is contained in:
commit
1229184088
3 changed files with 13 additions and 6 deletions
|
@ -397,8 +397,8 @@ class ElectrumXClient {
|
|||
|
||||
if (requestStrings.length > 1) {
|
||||
Logging.instance.log(
|
||||
"Map returned instead of a list and there are ${requestStrings.length} queued.",
|
||||
level: LogLevel.Error);
|
||||
"ElectrumXClient.batchRequest: Map returned instead of a list and there are ${requestStrings.length} queued.",
|
||||
level: LogLevel.Error);
|
||||
}
|
||||
// Could throw error here.
|
||||
} else {
|
||||
|
@ -757,7 +757,7 @@ class ElectrumXClient {
|
|||
|
||||
if (response is! Map) {
|
||||
final String msg = "getTransaction($txHash) returned a non-Map response"
|
||||
" of type ${response.runtimeType}.";
|
||||
" of type ${response.runtimeType}.\nResponse: $response";
|
||||
Logging.instance.log(msg, level: LogLevel.Fatal);
|
||||
throw Exception(msg);
|
||||
}
|
||||
|
@ -1032,7 +1032,14 @@ class ElectrumXClient {
|
|||
blocks,
|
||||
],
|
||||
);
|
||||
return Decimal.parse(response["result"].toString());
|
||||
try {
|
||||
return Decimal.parse(response["result"].toString());
|
||||
} catch (e, s) {
|
||||
final String msg = "Error parsing fee rate. Response: $response"
|
||||
"\nResult: ${response["result"]}\nError: $e\nStack trace: $s";
|
||||
Logging.instance.log(msg, level: LogLevel.Fatal);
|
||||
throw Exception(msg);
|
||||
}
|
||||
} catch (e) {
|
||||
rethrow;
|
||||
}
|
||||
|
|
|
@ -192,7 +192,7 @@ class BitcoincashWallet extends Bip39HDWallet
|
|||
addresses.addAll(prevOut.addresses);
|
||||
} catch (e, s) {
|
||||
Logging.instance.log(
|
||||
"Error getting prevOutJson: $s\nStack trace: $s",
|
||||
"Error getting prevOutJson: $e\nStack trace: $s",
|
||||
level: LogLevel.Warning);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -828,7 +828,7 @@ mixin ElectrumXInterface<T extends Bip39HDCurrency> on Bip39HDWallet<T> {
|
|||
|
||||
_latestHeight = chainHeight;
|
||||
|
||||
if (isFirstResponse) {
|
||||
if (isFirstResponse && !completer.isCompleted) {
|
||||
// Return the chain height.
|
||||
completer.complete(chainHeight);
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue