CW-719 Transaction dates shows incorrectly (#1685)
Some checks are pending
Cache Dependencies / test (push) Waiting to run

* ignore 0 height

* fix date format
This commit is contained in:
Serhii 2024-09-18 01:50:31 +03:00 committed by GitHub
parent 417de3669c
commit c6a4c69084
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 8 additions and 3 deletions

View file

@ -76,8 +76,13 @@ abstract class ElectrumTransactionHistoryBase
final val = entry.value; final val = entry.value;
if (val is Map<String, dynamic>) { if (val is Map<String, dynamic>) {
final tx = ElectrumTransactionInfo.fromJson(val, walletInfo.type); // removing transactions with invalid date
_update(tx); if (val['date'] == 1168650000) {
transactions.remove(entry.key);
} else {
final tx = ElectrumTransactionInfo.fromJson(val, walletInfo.type);
_update(tx);
}
} }
}); });

View file

@ -1613,7 +1613,7 @@ abstract class ElectrumWalletBase
} }
if (height != null) { if (height != null) {
if (time == null) { if (time == null && height > 0) {
time = (getDateByBitcoinHeight(height).millisecondsSinceEpoch / 1000).round(); time = (getDateByBitcoinHeight(height).millisecondsSinceEpoch / 1000).round();
} }