lamassu/lamassu-server — pull request #29 by chester1000 (2014-08-10 20:46:17+00:00)
Title: fix(trader): Ensure consolidation of only same-currency trades

Changes include:
* unbinding _private_, and pure methods from prototype of a `Trader` object:
* `Trader.prototype._findExchange` => `findExchange`,
* `Trader.prototype._findTicker` => `findTicker`,
* `Trader.prototype._findTrader` => `findTrader`,
* `Trader.prototype._findWallet` => `findWallet`.

* Some local variables renamed to improve readability:
* `tradeRec` => `consolidatedTrade`
* `tickerExchangeCode` => `tickerName`,
* `tickerExchangeConfig` => `tickerConfig`,
* `tradeExchangeCode` => `traderName`,
* `tradeExchangeCode` => `traderConfig`,
* `transferExchangeCode` => `walletName`,
* `transferExchangeConfig` => `walletConfig`.

* Since addition is commutative and order of looping doesn't matter: `while (true)` loop changed to `for..in`,
* `consolidateOther` and `otherCurencies` are used to consolidate if other currencies occur in queue.