Browse Source

Moved block minter sleep to later in the process, otherwise it can remain there for longer than expected.

block-minter-updates
CalDescent 3 years ago
parent
commit
a4cbbb3868
  1. 16
      src/main/java/org/qortal/controller/BlockMinter.java

16
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<MintingAccountData> 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()) {

Loading…
Cancel
Save