balanceHistory: fix groupBy parameter initialization

pull/345/head
Vladyslav Burzakovskyy 2020-01-07 14:43:21 +01:00 committed by Martin
parent 6919055e30
commit 94977dc5ef
1 changed files with 3 additions and 1 deletions

View File

@ -1060,8 +1060,10 @@ func (s *PublicServer) apiBalanceHistory(r *http.Request, apiVersion int) (inter
}
var groupBy uint32
i, err := strconv.ParseUint(r.URL.Query().Get("groupBy"), 10, 32)
if err == nil || i <= 0 {
if err != nil || i <= 0 {
groupBy = 3600
} else {
groupBy = uint32(i)
}
fiat := r.URL.Query().Get("fiatcurrency")