From a4cbbb38683557f88f3fc4539500140361a814a8 Mon Sep 17 00:00:00 2001 From: CalDescent Date: Sun, 30 Jan 2022 20:37:26 +0000 Subject: [PATCH] Moved block minter sleep to later in the process, otherwise it can remain there for longer than expected. --- .../java/org/qortal/controller/BlockMinter.java | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/src/main/java/org/qortal/controller/BlockMinter.java b/src/main/java/org/qortal/controller/BlockMinter.java index ddbf1929..a6aa21a8 100644 --- a/src/main/java/org/qortal/controller/BlockMinter.java +++ b/src/main/java/org/qortal/controller/BlockMinter.java @@ -118,14 +118,6 @@ public class BlockMinter extends Thread { if (mintingAccountsData.isEmpty()) continue; - if (parentSignatureForLastLowWeightBlock != null) { - // The last iteration found a higher weight block in the network, so sleep for a while - // to allow is to sync the higher weight chain. We are sleeping here rather than when - // detected as we don't want to hold the blockchain lock open. - LOGGER.info("Sleeping for 10 seconds..."); - Thread.sleep(10 * 1000L); - } - // Disregard minting accounts that are no longer valid, e.g. by transfer/loss of founder flag or account level // Note that minting accounts are actually reward-shares in Qortal Iterator madi = mintingAccountsData.iterator(); @@ -219,6 +211,14 @@ public class BlockMinter extends Thread { continue; } + if (parentSignatureForLastLowWeightBlock != null) { + // The last iteration found a higher weight block in the network, so sleep for a while + // to allow is to sync the higher weight chain. We are sleeping here rather than when + // detected as we don't want to hold the blockchain lock open. + LOGGER.info("Sleeping for 10 seconds..."); + Thread.sleep(10 * 1000L); + } + for (PrivateKeyAccount mintingAccount : newBlocksMintingAccounts) { // First block does the AT heavy-lifting if (newBlocks.isEmpty()) {