mirror of
https://github.com/boldsuck/haveno.git
synced 2025-01-03 14:49:25 +00:00
deduplicate trade history before may 31, 2024
This commit is contained in:
parent
3fbb2f95d0
commit
6df5296dcd
1 changed files with 4 additions and 4 deletions
|
@ -113,15 +113,15 @@ public class TradeStatisticsManager {
|
||||||
|
|
||||||
private void deduplicateEarlyTradeStatistics(Set<TradeStatistics3> set) {
|
private void deduplicateEarlyTradeStatistics(Set<TradeStatistics3> set) {
|
||||||
|
|
||||||
// collect trades before May 18, 2024
|
// collect trades before May 31, 2024
|
||||||
Set<TradeStatistics3> tradesBeforeMay18_24 = set.stream()
|
Set<TradeStatistics3> tradesBeforeMay31_24 = set.stream()
|
||||||
.filter(e -> e.getDate().toInstant().isBefore(Instant.parse("2024-05-18T00:00:00Z")))
|
.filter(e -> e.getDate().toInstant().isBefore(Instant.parse("2024-05-31T00:00:00Z")))
|
||||||
.collect(Collectors.toSet());
|
.collect(Collectors.toSet());
|
||||||
|
|
||||||
// collect duplicated trades
|
// collect duplicated trades
|
||||||
Set<TradeStatistics3> duplicated = new HashSet<TradeStatistics3>();
|
Set<TradeStatistics3> duplicated = new HashSet<TradeStatistics3>();
|
||||||
Set<TradeStatistics3> deduplicated = 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);
|
if (hasLenientDuplicate(tradeStatistics, deduplicated)) duplicated.add(tradeStatistics);
|
||||||
else deduplicated.add(tradeStatistics);
|
else deduplicated.add(tradeStatistics);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue