Make sure heights are always updated of transaction cache.
MODIFY
WalletWasabi.Gui/Controls/WalletExplorer/HistoryTabViewModel.cs
WalletWasabi.Gui/Controls/WalletExplorer/HistoryTabViewModel.cs
@@ -12,6 +12,7 @@ using System.Reactive.Linq;
using System.Text;
using System.Threading;
using System.Threading.Tasks;
+using WalletWasabi.Logging;
using WalletWasabi.Models;
using WalletWasabi.Services;

MODIFY
WalletWasabi/Services/WalletService.cs
WalletWasabi/Services/WalletService.cs
@@ -311,9 +311,14 @@ namespace WalletWasabi.Services
private void ProcessTransaction(SmartTransaction tx, List<HdPubKey> keys = null)
{
- if (tx.Height != Height.MemPool && tx.Height != Height.Unknown)
+ if (tx.Height.Type == HeightType.Chain)
{
- MemPool.TransactionHashes.TryRemove(tx.GetHash());
+ MemPool.TransactionHashes.TryRemove(tx.GetHash()); // If we have in mempool, remove.
+ SmartTransaction foundTx = TransactionCache.FirstOrDefault(x => x.GetHash() == tx.GetHash()); // If we have in cache, update height.
+ if (foundTx != default(SmartTransaction))
+ {
+ foundTx.SetHeight(tx.Height);
+ }
}
//iterate tx
@@ -350,11 +355,6 @@ namespace WalletWasabi.Services
if (tx.Height != Height.MemPool)
{
foundCoin.Height = tx.Height;
- SmartTransaction foundTx = TransactionCache.FirstOrDefault(x => x.GetHash() == tx.GetHash());
- if (foundTx != default(SmartTransaction))
- {
- foundTx.SetHeight(tx.Height);
- }
}
}
}

Make sure heights are always updated of transaction cache.