CW-719 Transaction dates shows incorrectly (#1685)
* ignore 0 height * fix date format
Serhii committed
Sep 18, 2024 at 01:50 UTC
c6a4c69084baa5cc8feadd967afb6d9a945acaf4
2 files changed
+8
-3
cw_bitcoin/lib/electrum_transaction_history.dart
+7
-2
@@ -76,8 +76,13 @@ abstract class ElectrumTransactionHistoryBase
76
final val = entry.value;
77
78
if (val is Map<String, dynamic>) {
79
- final tx = ElectrumTransactionInfo.fromJson(val, walletInfo.type);
80
- _update(tx);
79
+ // removing transactions with invalid date
80
+ if (val['date'] == 1168650000) {
81
+ transactions.remove(entry.key);
82
+ } else {
83
+ final tx = ElectrumTransactionInfo.fromJson(val, walletInfo.type);
84
+ _update(tx);
85
+ }
86
}
87
});
88
cw_bitcoin/lib/electrum_wallet.dart
+1
-1
@@ -1613,7 +1613,7 @@ abstract class ElectrumWalletBase
1613
}
1614
1615
if (height != null) {
1616
- if (time == null) {
1616
+ if (time == null && height > 0) {
1617
time = (getDateByBitcoinHeight(height).millisecondsSinceEpoch / 1000).round();
1618
}
1619