Don't submit online accounts if node is more than 2 hours of sync.

This commit is contained in:
CalDescent 2022-06-19 18:56:08 +01:00
parent 96cdf4a87e
commit 38faed5799

View File

@ -280,6 +280,12 @@ public class OnlineAccountsManager extends Thread {
return; return;
} }
// Don't submit if we're more than 2 hours out of sync
final Long minLatestBlockTimestamp = now - (2 * 60 * 60 * 1000L);
if (!Controller.getInstance().isUpToDate(minLatestBlockTimestamp)) {
return;
}
List<MintingAccountData> mintingAccounts; List<MintingAccountData> mintingAccounts;
try (final Repository repository = RepositoryManager.getRepository()) { try (final Repository repository = RepositoryManager.getRepository()) {
mintingAccounts = repository.getAccountRepository().getMintingAccounts(); mintingAccounts = repository.getAccountRepository().getMintingAccounts();