balanceHistory: remove empty currencies from the list, fix typo

pull/359/head
Vladyslav Burzakovskyy 2020-01-28 12:21:41 +01:00 committed by Martin
parent 95ac05b280
commit 82debaa50e
1 changed files with 2 additions and 1 deletions

View File

@ -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 {