Don't process trade bots or broadcast presence timestamps if our chain is more than 30 minutes old

This commit is contained in:
CalDescent 2022-03-30 08:11:02 +01:00
parent d420033b36
commit 15ff8af7ac

View File

@ -239,6 +239,11 @@ public class TradeBot implements Listener {
if (!(event instanceof Synchronizer.NewChainTipEvent))
return;
// Don't process trade bots or broadcast presence timestamps if our chain is more than 30 minutes old
final Long minLatestBlockTimestamp = NTP.getTime() - (30 * 60 * 1000L);
if (!Controller.getInstance().isUpToDate(minLatestBlockTimestamp))
return;
synchronized (this) {
expireOldPresenceTimestamps();