From def75ff1bc0dd5f7c86086190c19fbce030112ad Mon Sep 17 00:00:00 2001 From: jysperm Date: Sat, 21 Jun 2014 13:48:55 +0800 Subject: [PATCH] =?UTF-8?q?=E6=8C=89=E7=85=A7=E5=AE=9E=E6=97=B6=E6=B1=87?= =?UTF-8?q?=E7=8E=87=E8=BF=9B=E8=A1=8C=E5=85=85=E5=80=BC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- core/bitcoin.coffee | 19 ++++++++++--------- core/config.coffee | 1 - 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/core/bitcoin.coffee b/core/bitcoin.coffee index 2b53db8..48832a3 100644 --- a/core/bitcoin.coffee +++ b/core/bitcoin.coffee @@ -30,13 +30,14 @@ exports.doCallback = (data, callback) -> unless data.secret == account.blockchain_secret return callback 'Invalid Secret' - if data.confirmations > config.bitcoin.confirmations - amount = parseFloat(data.value) / config.bitcoin.sbtc2cny + exports.getExchangeRate (rate) -> + if data.confirmations > config.bitcoin.confirmations + amount = parseFloat(data.value) / 100000000 / rate - mAccount.incBalance account, 'deposit', amount, - type: 'bitcoin' - order_id: data.input_transaction_hash - , -> - callback '*OK*' - else - callback 'Confirmations Insufficient' \ No newline at end of file + mAccount.incBalance account, 'deposit', amount, + type: 'bitcoin' + order_id: data.input_transaction_hash + , -> + callback '*OK*' + else + callback 'Confirmations Insufficient' diff --git a/core/config.coffee b/core/config.coffee index 71c665d..b770d63 100644 --- a/core/config.coffee +++ b/core/config.coffee @@ -47,7 +47,6 @@ module.exports = bitcoin: forward_to: '1FjhhWrzAvb9YD4tVdbE6wrSoHSwxMJoWe' confirmations: 1 - sbtc2cny: 25000 plugins: mysql: