class NodeBlockProcessor implements BlockProcessor {

    @Override
    public void processBlockHeadersRequest(@Nonnull final MessageChannel sender, long requestId, @Nonnull final byte[] hash, int count) {
        logger.trace("Processing headers request {} {} from {}", requestId, Hex.toHexString(hash).substring(0, 10), sender.getPeerNodeID());
        Block block = blockSyncService.getBlockFromStoreOrBlockchain(hash);

        if (block == null) {
            return;
        }

        List<BlockHeader> headers = new ArrayList<>();
        headers.add(block.getHeader());

        for (int k = 1; k < count; k++) {
            block = blockSyncService.getBlockFromStoreOrBlockchain(block.getParentHash().getBytes());

            if (block == null) {
                break;
            }

            headers.add(block.getHeader());
        }

        BlockHeadersResponseMessage response = new BlockHeadersResponseMessage(requestId, headers);

        sender.sendMessage(response);
    }

    public  NodeBlockProcessor(
            @Nonnull final BlockStore store,
            @Nonnull final Blockchain blockchain,
            @Nonnull final BlockNodeInformation nodeInformation,
            @Nonnull final BlockSyncService blockSyncService,
            @Nonnull final SyncConfiguration syncConfiguration);

}