class MainnetBlockImporter implements BlockImporter {

  @Override
  public synchronized boolean importBlock(
      final ProtocolContext context,
      final Block block,
      final HeaderValidationMode headerValidationMode,
      final HeaderValidationMode ommerValidationMode) {
    if (context.getBlockchain().contains(block.getHash())) {
      return true;
    }

    final Optional<BlockValidator.BlockProcessingOutputs> outputs =
        blockValidator.validateAndProcessBlock(
            context, block, headerValidationMode, ommerValidationMode);

    outputs.ifPresent(
        processingOutputs ->
            context.getBlockchain().appendBlock(block, processingOutputs.receipts));

    return outputs.isPresent();
  }

  public  MainnetBlockImporter(final BlockValidator blockValidator);

}