<commit_before>package core

import (
	"net/http"
	"strconv"

	"github.com/kristjank/goark-node/api/model"
)

//GetFullBlocksFromPeer function returns a full list of blocks. A radnom number of blocks is returned,
//due to ddos measures
func (s *ArkClient) GetFullBlocksFromPeer(lastBlockHeight int) (model.BlockResponse, *http.Response, error) {
	respData := new(model.BlockResponse)
	respError := new(ArkApiResponseError)

	qstr := "lastBlockHeight=" + strconv.Itoa(lastBlockHeight)

	resp, err := s.sling.New().Get("api/blocks/?"+qstr).Receive(respData, respError)
	if err == nil {
		err = respError
	}

	return *respData, resp, err
}

//GetPeerHeight function returns node peer height.
func (s *ArkClient) GetPeerHeight() (model.BlockHeightResponse, *http.Response, error) {
	respError := new(ArkApiResponseError)
	respData := new(model.BlockHeightResponse)

	resp, err := s.sling.New().Get("api/blocks/getHeight").Receive(respData, respError)
	if err == nil {
		err = respError
	}

	return *respData, resp, err<commit_msg>Fix on get block call from api to peer<commit_after>package core

import (
	"net/http"
	"strconv"

	"github.com/kristjank/goark-node/api/model"
)

//GetFullBlocksFromPeer function returns a full list of blocks from current last block on. A random number of blocks is returned,
//due to ddos measures
func (s *ArkClient) GetFullBlocksFromPeer(lastBlockHeight int) (model.BlockResponse, *http.Response, error) {
	respData := new(model.BlockResponse)
	respError := new(ArkApiResponseError)

	qstr := "lastBlockHeight=" + strconv.Itoa(lastBlockHeight)

	resp, err := s.sling.New().Get("peer/blocks?"+qstr).Receive(respData, respError)
	if err == nil {
		err = respError
	}

	return *respData, resp, err
}

//GetPeerHeight function returns node peer height.
func (s *ArkClient) GetPeerHeight() (model.BlockHeightResponse, *http.Response, error) {
	respError := new(ArkApiResponseError)
	respData := new(model.BlockHeightResponse)

	resp, err := s.sling.New().Get("api/blocks/getHeight").Receive(respData, respError)
	if err == nil {
		err = respError
	}

	return *respData, resp, err
{'fraction_non_alphanumeric': 0.12785171102661597, 'fraction_numerical': 0.0, 'mean_word_length': 5.101449275362318, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6108375', 'n_tokens_mistral': 724, 'n_tokens_neox': 701, 'n_words': 178}