Skip to content

Commit

Permalink
CW-719 Transaction dates shows incorrectly (#1685)
Browse files Browse the repository at this point in the history
* ignore 0 height

* fix date format
  • Loading branch information
Serhii-Borodenko authored Sep 17, 2024
1 parent 417de36 commit c6a4c69
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 3 deletions.
9 changes: 7 additions & 2 deletions cw_bitcoin/lib/electrum_transaction_history.dart
Original file line number Diff line number Diff line change
Expand Up @@ -76,8 +76,13 @@ abstract class ElectrumTransactionHistoryBase
final val = entry.value;

if (val is Map<String, dynamic>) {
final tx = ElectrumTransactionInfo.fromJson(val, walletInfo.type);
_update(tx);
// removing transactions with invalid date
if (val['date'] == 1168650000) {
transactions.remove(entry.key);
} else {
final tx = ElectrumTransactionInfo.fromJson(val, walletInfo.type);
_update(tx);
}
}
});

Expand Down
2 changes: 1 addition & 1 deletion cw_bitcoin/lib/electrum_wallet.dart
Original file line number Diff line number Diff line change
Expand Up @@ -1613,7 +1613,7 @@ abstract class ElectrumWalletBase
}

if (height != null) {
if (time == null) {
if (time == null && height > 0) {
time = (getDateByBitcoinHeight(height).millisecondsSinceEpoch / 1000).round();
}

Expand Down

0 comments on commit c6a4c69

Please sign in to comment.