public static boolean addressIsAllowedToProduceNextBlock(
      final Address candidate, final ProtocolContext protocolContext, final BlockHeader parent) {
    final ValidatorProvider validatorProvider =
        protocolContext.getConsensusContext(CliqueContext.class).getValidatorProvider();

    if (!isSigner(candidate, protocolContext, parent)) {
      return false;
    }

    final int minimumUnsignedPastBlocks =
        minimumBlocksSincePreviousSigning(parent, validatorProvider);

    final Blockchain blockchain = protocolContext.getBlockchain();
    int unsignedBlockCount = 0;
    BlockHeader localParent = parent;

    while (unsignedBlockCount < minimumUnsignedPastBlocks) {

      if (localParent.getNumber() == 0) {
        return true;
      }

      final Address parentSigner = CliqueHelpers.getProposerOfBlock(localParent);
      if (parentSigner.equals(candidate)) {
        return false;
      }
      unsignedBlockCount++;

      localParent =
          blockchain
              .getBlockHeader(localParent.getParentHash())
              .orElseThrow(() -> new IllegalStateException("The block was on a orphaned chain."));
    }

    return true;
  }
Address is allowed to produce next block.

@param candidate the candidate
@param protocolContext the protocol context
@param parent the parent
@return the boolean
consensus/clique/src/main/java/org/hyperledger/besu/consensus/clique/CliqueHelpers.java