mirror of
https://github.com/Qortal/qortal.git
synced 2025-03-13 11:12:31 +00:00
Revert "Removed "consecutive blocks" limitation in block minter."
This reverts commit f41fbb3b3d9b4b7f6ec44686fdd1f69ede08fb3e.
This commit is contained in:
parent
48b562f71b
commit
2478450694
@ -212,6 +212,14 @@ public class BlockMinter extends Thread {
|
|||||||
// Do we need to build any potential new blocks?
|
// Do we need to build any potential new blocks?
|
||||||
List<PrivateKeyAccount> newBlocksMintingAccounts = mintingAccountsData.stream().map(accountData -> new PrivateKeyAccount(repository, accountData.getPrivateKey())).collect(Collectors.toList());
|
List<PrivateKeyAccount> newBlocksMintingAccounts = mintingAccountsData.stream().map(accountData -> new PrivateKeyAccount(repository, accountData.getPrivateKey())).collect(Collectors.toList());
|
||||||
|
|
||||||
|
// We might need to sit the next block out, if one of our minting accounts signed the previous one
|
||||||
|
final byte[] previousBlockMinter = previousBlockData.getMinterPublicKey();
|
||||||
|
final boolean mintedLastBlock = mintingAccountsData.stream().anyMatch(mintingAccount -> Arrays.equals(mintingAccount.getPublicKey(), previousBlockMinter));
|
||||||
|
if (mintedLastBlock) {
|
||||||
|
LOGGER.trace(String.format("One of our keys signed the last block, so we won't sign the next one"));
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
if (parentSignatureForLastLowWeightBlock != null) {
|
if (parentSignatureForLastLowWeightBlock != null) {
|
||||||
// The last iteration found a higher weight block in the network, so sleep for a while
|
// 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
|
// to allow is to sync the higher weight chain. We are sleeping here rather than when
|
||||||
|
Loading…
x
Reference in New Issue
Block a user