From dd80eecdfb21786b2a0a694b41db1850ea9d78d3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Maciej=20Ma=C5=82ecki?= Date: Mon, 14 Apr 2014 15:41:06 +0200 Subject: [PATCH] Fix `fiatBalance` --- lib/trader.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/trader.js b/lib/trader.js index 2175dd1c..81de3832 100644 --- a/lib/trader.js +++ b/lib/trader.js @@ -81,7 +81,7 @@ Trader.prototype.configure = function (config) { * return balance in satoshis */ Trader.prototype.fiatBalance = function (transferSatoshis, tradeFiat) { - var rate = this.rate; + var rate = this.rate(this.config.exchanges.settings.currency).rate; var balance = this.balance; var commission = this.config.exchanges.settings.commission; @@ -92,7 +92,7 @@ Trader.prototype.fiatBalance = function (transferSatoshis, tradeFiat) { // `lowBalanceMargin` is our safety net. It's a number > 1, and we divide // all our balances by it to provide a safety margin. - var lowBalanceMargin = this.config.settings.lowBalanceMargin; + var lowBalanceMargin = this.config.exchanges.settings.lowBalanceMargin; // `balance.transferBalance` is the balance of our transfer account (the one // we use to send Bitcoins to clients). `transferSatoshis` is the number