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,9 +76,14 @@ abstract class ElectrumTransactionHistoryBase
final val = entry.value;
if (val is Map<String, dynamic>) {
// removing transactions with invalid date
if (val['date'] == 1168650000) {
transactions.remove(entry.key);
} else {
final tx = ElectrumTransactionInfo.fromJson(val, walletInfo.type);
_update(tx);
}
}
});
_height = content['height'] as int;

View file

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