mirror of
https://github.com/haveno-dex/haveno.git
synced 2024-10-01 01:35:48 -04:00
deduplicate trade history before may 31, 2024
This commit is contained in:
parent
3fbb2f95d0
commit
6df5296dcd
@ -113,15 +113,15 @@ public class TradeStatisticsManager {
|
||||
|
||||
private void deduplicateEarlyTradeStatistics(Set<TradeStatistics3> set) {
|
||||
|
||||
// collect trades before May 18, 2024
|
||||
Set<TradeStatistics3> tradesBeforeMay18_24 = set.stream()
|
||||
.filter(e -> e.getDate().toInstant().isBefore(Instant.parse("2024-05-18T00:00:00Z")))
|
||||
// collect trades before May 31, 2024
|
||||
Set<TradeStatistics3> tradesBeforeMay31_24 = set.stream()
|
||||
.filter(e -> e.getDate().toInstant().isBefore(Instant.parse("2024-05-31T00:00:00Z")))
|
||||
.collect(Collectors.toSet());
|
||||
|
||||
// collect duplicated trades
|
||||
Set<TradeStatistics3> duplicated = new HashSet<TradeStatistics3>();
|
||||
Set<TradeStatistics3> deduplicated = new HashSet<TradeStatistics3>();
|
||||
for (TradeStatistics3 tradeStatistics : tradesBeforeMay18_24) {
|
||||
for (TradeStatistics3 tradeStatistics : tradesBeforeMay31_24) {
|
||||
if (hasLenientDuplicate(tradeStatistics, deduplicated)) duplicated.add(tradeStatistics);
|
||||
else deduplicated.add(tradeStatistics);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user