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: