From 26ae44b2a796513849f002127e8eb5dd8ba355d8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Maciej=20Ma=C5=82ecki?= Date: Tue, 15 Apr 2014 14:32:43 +0200 Subject: [PATCH] Remove balance calculation for trading Trading feature is not used in production, remove it for now. --- lib/trader.js | 16 +--------------- 1 file changed, 1 insertion(+), 15 deletions(-) diff --git a/lib/trader.js b/lib/trader.js index 81de3832..733d9d70 100644 --- a/lib/trader.js +++ b/lib/trader.js @@ -109,21 +109,7 @@ Trader.prototype.fiatBalance = function (transferSatoshis, tradeFiat) { // [ $ ] = [ $ ] var fiatTransferBalance = ((adjustedTransferBalance / SATOSHI_FACTOR) * rate) / lowBalanceMargin; - // If this server is also configured to trade received fiat for Bitcoins, - // we also need to calculate if we have enough funds on our trade exchange. - if (balance.tradeBalance === null) return fiatTransferBalance; - var tradeBalance = balance.tradeBalance; - - // We need to secure `tradeFiat` (amount of fiat in this transaction) and - // enough fiat to cover our trading queue (trades aren't executed immediately). - var adjustedFiat = tradeFiat + exports.trade.queueFiatBalance(rate); - - // So we subtract `adjustedFiat` from `tradeBalance` and again, apply - // `lowBalanceMargin`. - var fiatTradeBalance = (tradeBalance - adjustedFiat) / lowBalanceMargin; - - // And we return the smallest number. - return Math.min(fiatTransferBalance, fiatTradeBalance); + return fiatTransferBalance; }; Trader.prototype.sendBitcoins = function (deviceFingerprint, tx, cb) {