Add generalised functions for handling exchange enabled and available currencies

This commit is contained in:
Adrian Gallagher
2017-08-25 15:54:45 +10:00
parent 9bdc316ae8
commit 55ea1fe434
45 changed files with 1032 additions and 208 deletions

View File

@@ -22,8 +22,9 @@ func (i *ItBit) Run() {
}
for i.Enabled {
for _, x := range i.EnabledPairs {
currency := pair.NewCurrencyPair(x[0:3], x[3:])
pairs := i.GetEnabledCurrencies()
for x := range pairs {
currency := pairs[x]
go func() {
ticker, err := i.GetTickerPrice(currency)
if err != nil {