Add OrderByBlockchain
MODIFY
WalletWasabi/Extensions/LinqExtensions.cs
WalletWasabi/Extensions/LinqExtensions.cs
@@ -136,6 +136,12 @@ namespace System.Linq
.ThenBy(x => x.BlockIndex)
.ThenBy(x => x.FirstSeen);
+ public static IOrderedEnumerable<TransactionSummary> OrderByBlockchain(this IEnumerable<TransactionSummary> me)
+ => me
+ .OrderBy(x => x.Height)
+ .ThenBy(x => x.BlockIndex)
+ .ThenBy(x => x.DateTime);
+
public static IEnumerable<string> ToBlockchainOrderedLines(this IEnumerable<SmartTransaction> me)
=> me
.OrderByBlockchain()

MODIFY
WalletWasabi/Models/TransactionSummaryData.cs
WalletWasabi/Models/TransactionSummaryData.cs
@@ -11,5 +11,6 @@ namespace WalletWasabi.Models
public Money Amount { get; set; }
public string Label { get; set; }
public uint256 TransactionId { get; set; }
+ public int BlockIndex { get; set; }
}
}

MODIFY
WalletWasabi/Services/TransactionHistoryBuilder.cs
WalletWasabi/Services/TransactionHistoryBuilder.cs
@@ -68,7 +68,8 @@ namespace WalletWasabi.Services
Height = coin.Height,
Amount = coin.Amount,
Label = coin.Label.ToString(),
- TransactionId = coin.TransactionId
+ TransactionId = coin.TransactionId,
+ BlockIndex = foundTransaction.BlockIndex
});
}
@@ -109,12 +110,13 @@ namespace WalletWasabi.Services
Height = foundSpenderTransaction.Height,
Amount = (Money.Zero - coin.Amount),
Label = "",
- TransactionId = coin.SpenderTransactionId
+ TransactionId = coin.SpenderTransactionId,
+ BlockIndex = foundSpenderTransaction.BlockIndex
});
}
}
}
- txRecordList = txRecordList.OrderByDescending(x => x.DateTime).ThenBy(x => x.Amount).ToList();
+ txRecordList = txRecordList.OrderByBlockchain().ToList();
return txRecordList;
}
}

Add OrderByBlockchain