mirror of
https://github.com/cake-tech/cake_wallet.git
synced 2024-12-22 11:39:22 +00:00
feat: add onError exception (#1743)
Some checks failed
Cache Dependencies / test (push) Has been cancelled
Some checks failed
Cache Dependencies / test (push) Has been cancelled
This commit is contained in:
parent
62f55ae8f5
commit
8acf8bdfb2
1 changed files with 10 additions and 4 deletions
|
@ -1315,7 +1315,7 @@ abstract class ElectrumWalletBase
|
||||||
|
|
||||||
// Set the balance of all non-silent payment addresses to 0 before updating
|
// Set the balance of all non-silent payment addresses to 0 before updating
|
||||||
walletAddresses.allAddresses.forEach((addr) {
|
walletAddresses.allAddresses.forEach((addr) {
|
||||||
if(addr is! BitcoinSilentPaymentAddressRecord) addr.balance = 0;
|
if (addr is! BitcoinSilentPaymentAddressRecord) addr.balance = 0;
|
||||||
});
|
});
|
||||||
|
|
||||||
await Future.wait(walletAddresses.allAddresses.map((address) async {
|
await Future.wait(walletAddresses.allAddresses.map((address) async {
|
||||||
|
@ -1825,6 +1825,8 @@ abstract class ElectrumWalletBase
|
||||||
|
|
||||||
Future<Map<String, ElectrumTransactionInfo>> _fetchAddressHistory(
|
Future<Map<String, ElectrumTransactionInfo>> _fetchAddressHistory(
|
||||||
BitcoinAddressRecord addressRecord, int? currentHeight) async {
|
BitcoinAddressRecord addressRecord, int? currentHeight) async {
|
||||||
|
String txid = "";
|
||||||
|
|
||||||
try {
|
try {
|
||||||
final Map<String, ElectrumTransactionInfo> historiesWithDetails = {};
|
final Map<String, ElectrumTransactionInfo> historiesWithDetails = {};
|
||||||
|
|
||||||
|
@ -1834,7 +1836,7 @@ abstract class ElectrumWalletBase
|
||||||
addressRecord.setAsUsed();
|
addressRecord.setAsUsed();
|
||||||
|
|
||||||
await Future.wait(history.map((transaction) async {
|
await Future.wait(history.map((transaction) async {
|
||||||
final txid = transaction['tx_hash'] as String;
|
txid = transaction['tx_hash'] as String;
|
||||||
final height = transaction['height'] as int;
|
final height = transaction['height'] as int;
|
||||||
final storedTx = transactionHistory.transactions[txid];
|
final storedTx = transactionHistory.transactions[txid];
|
||||||
|
|
||||||
|
@ -1865,8 +1867,12 @@ abstract class ElectrumWalletBase
|
||||||
}
|
}
|
||||||
|
|
||||||
return historiesWithDetails;
|
return historiesWithDetails;
|
||||||
} catch (e) {
|
} catch (e, stacktrace) {
|
||||||
print(e.toString());
|
_onError?.call(FlutterErrorDetails(
|
||||||
|
exception: "$txid - $e",
|
||||||
|
stack: stacktrace,
|
||||||
|
library: this.runtimeType.toString(),
|
||||||
|
));
|
||||||
return {};
|
return {};
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue