only retain one day of mempool rate sizes

This commit is contained in:
Craig Raw 2022-01-14 08:26:59 +02:00
parent 82f9a0f2af
commit 7423d94935

View file

@ -615,6 +615,9 @@ public class AppServices {
} }
mempoolHistogram.put(Date.from(dateMinute.atZone(ZoneId.systemDefault()).toInstant()), rateSizes); mempoolHistogram.put(Date.from(dateMinute.atZone(ZoneId.systemDefault()).toInstant()), rateSizes);
Date yesterday = Date.from(LocalDateTime.now().minusDays(1).atZone(ZoneId.systemDefault()).toInstant());
mempoolHistogram.keySet().removeIf(date -> date.before(yesterday));
} }
public static Double getMinimumRelayFeeRate() { public static Double getMinimumRelayFeeRate() {