From 82debaa50e80ecabe591d5dcab403d6cdbbd178c Mon Sep 17 00:00:00 2001 From: Vladyslav Burzakovskyy Date: Tue, 28 Jan 2020 12:21:41 +0100 Subject: [PATCH] balanceHistory: remove empty currencies from the list, fix typo --- api/worker.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/api/worker.go b/api/worker.go index 499c74f2..42f881b3 100644 --- a/api/worker.go +++ b/api/worker.go @@ -945,6 +945,7 @@ func (w *Worker) setFiatRateToBalanceHistories(histories BalanceHistories, curre // GetBalanceHistory returns history of balance for given address func (w *Worker) GetBalanceHistory(address string, fromTimestamp, toTimestamp int64, currencies []string, groupBy uint32) (BalanceHistories, error) { + currencies = removeEmpty(currencies) bhs := make(BalanceHistories, 0) start := time.Now() addrDesc, _, err := w.getAddrDescAndNormalizeAddress(address) @@ -1155,7 +1156,7 @@ func (w *Worker) GetBlocks(page int, blocksOnPage int) (*Blocks, error) { return r, nil } -// removeEmty removes empty strings from a slice +// removeEmpty removes empty strings from a slice func removeEmpty(stringSlice []string) []string { var ret []string for _, str := range stringSlice {