From c6a4c69084baa5cc8feadd967afb6d9a945acaf4 Mon Sep 17 00:00:00 2001 From: Serhii Date: Wed, 18 Sep 2024 01:50:31 +0300 Subject: [PATCH] CW-719 Transaction dates shows incorrectly (#1685) * ignore 0 height * fix date format --- cw_bitcoin/lib/electrum_transaction_history.dart | 9 +++++++-- cw_bitcoin/lib/electrum_wallet.dart | 2 +- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/cw_bitcoin/lib/electrum_transaction_history.dart b/cw_bitcoin/lib/electrum_transaction_history.dart index 806f813dd..b688f097b 100644 --- a/cw_bitcoin/lib/electrum_transaction_history.dart +++ b/cw_bitcoin/lib/electrum_transaction_history.dart @@ -76,8 +76,13 @@ abstract class ElectrumTransactionHistoryBase final val = entry.value; if (val is Map) { - 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); + } } }); diff --git a/cw_bitcoin/lib/electrum_wallet.dart b/cw_bitcoin/lib/electrum_wallet.dart index 191272b1f..fe8782adb 100644 --- a/cw_bitcoin/lib/electrum_wallet.dart +++ b/cw_bitcoin/lib/electrum_wallet.dart @@ -1613,7 +1613,7 @@ abstract class ElectrumWalletBase } if (height != null) { - if (time == null) { + if (time == null && height > 0) { time = (getDateByBitcoinHeight(height).millisecondsSinceEpoch / 1000).round(); }