Skip to content

Commit

Permalink
Config: Remove CheckPairCurrensistency per asset random pair enabling
Browse files Browse the repository at this point in the history
If all pairs aren't available, previously we'd call StorePairs and that
would leave the assetType enabled, but with nothing in pairs enabled, so
we'd turn one on randomly.

Now StorePairs will always disable assetTypes which have no enabled
pairs, so we'd always skip the end of this per-asset check.

This does not prevent the overall "At least one pair for one asset must
be turned on" logic that happens later, though I don't agree with that
either, I'm not being forced to fix it right now. Baby steps.
  • Loading branch information
gbjk committed Nov 27, 2024
1 parent 0d39da1 commit 0d605aa
Showing 1 changed file with 0 additions and 22 deletions.
22 changes: 0 additions & 22 deletions config/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -553,29 +553,7 @@ func (c *Config) CheckPairConsistency(exchName string) error {

if len(pairs) != 0 {
atLeastOneEnabled = true
continue
}

enabled, err := c.AssetTypeEnabled(assetTypes[x], exchName)
if err != nil {
return err
}

if !enabled {
continue
}

var rPair currency.Pair
rPair, err = availPairs.GetRandomPair()
if err != nil {
return err
}

err = c.SetPairs(exchName, assetTypes[x], true, currency.Pairs{rPair})
if err != nil {
return err
}
atLeastOneEnabled = true
}

// If no pair is enabled across the entire range of assets, then at least
Expand Down

0 comments on commit 0d605aa

Please sign in to comment.