WIP: trade-bot: do not run trade-bot if not up-to-date

This commit is contained in:
catbref 2020-06-24 17:31:30 +01:00
parent f179139967
commit e729571a21

View File

@ -155,6 +155,10 @@ public class TradeBot {
} }
public void onChainTipChange() { public void onChainTipChange() {
// No point doing anything on old/stale data
if (!Controller.getInstance().isUpToDate())
return;
if (!activeFlag.compareAndSet(false, true)) if (!activeFlag.compareAndSet(false, true))
// Trade bot already active on another thread // Trade bot already active on another thread
return; return;