|
|
@ -537,9 +537,14 @@ OUTER:
|
|
|
|
continue
|
|
|
|
continue
|
|
|
|
}
|
|
|
|
}
|
|
|
|
// check not already found
|
|
|
|
// check not already found
|
|
|
|
|
|
|
|
updateSlice := -1
|
|
|
|
for j := range sliced {
|
|
|
|
for j := range sliced {
|
|
|
|
if coin.Symbol == sliced[j].Symbol {
|
|
|
|
if coin.Symbol == sliced[j].Symbol {
|
|
|
|
continue OUTER
|
|
|
|
if coin.Rank >= sliced[j].Rank {
|
|
|
|
|
|
|
|
continue OUTER // skip updates from lower-ranked coins
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
updateSlice = j // update this later
|
|
|
|
|
|
|
|
break
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
@ -551,7 +556,12 @@ OUTER:
|
|
|
|
}
|
|
|
|
}
|
|
|
|
balance, _ = strconv.ParseFloat(balancestr, 64)
|
|
|
|
balance, _ = strconv.ParseFloat(balancestr, 64)
|
|
|
|
coin.Balance = balance
|
|
|
|
coin.Balance = balance
|
|
|
|
|
|
|
|
if updateSlice == -1 {
|
|
|
|
sliced = append(sliced, coin)
|
|
|
|
sliced = append(sliced, coin)
|
|
|
|
|
|
|
|
} else {
|
|
|
|
|
|
|
|
sliced[updateSlice] = coin
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
sort.Slice(sliced, func(i, j int) bool {
|
|
|
|
sort.Slice(sliced, func(i, j int) bool {
|
|
|
|