renamed cryptoUnits to cryptoAtoms for clarity
This commit is contained in:
parent
e462359299
commit
8d44c1d383
2 changed files with 9 additions and 9 deletions
|
|
@ -248,28 +248,28 @@ exports.pollQueries = function pollQueries (session, cb) {
|
|||
})
|
||||
}
|
||||
|
||||
function _sendCoins (toAddress, cryptoUnits, cryptoCoin, cb) {
|
||||
function _sendCoins (toAddress, cryptoAtoms, cryptoCoin, cb) {
|
||||
var cryptoCode = cryptoCoin.unitCode
|
||||
var walletPlugin = walletPlugins[cryptoCode]
|
||||
var transactionFee = cachedConfig.exchanges.settings.transactionFee
|
||||
if (cryptoCode === 'BTC') {
|
||||
walletPlugin.sendBitcoins(toAddress, cryptoUnits, transactionFee, cb)
|
||||
walletPlugin.sendBitcoins(toAddress, cryptoAtoms, transactionFee, cb)
|
||||
} else {
|
||||
walletPlugin.sendCoins(toAddress, cryptoUnits, cryptoCoin, transactionFee, cb)
|
||||
walletPlugin.sendCoins(toAddress, cryptoAtoms, cryptoCoin, transactionFee, cb)
|
||||
}
|
||||
}
|
||||
|
||||
function executeTx (session, tx, authority, cb) {
|
||||
db.addOutgoingTx(session, tx, function (err, toSend) {
|
||||
if (err) return cb(err)
|
||||
var cryptoUnitsToSend = toSend.cryptoUnits
|
||||
if (cryptoUnitsToSend === 0) {
|
||||
var cryptoAtomsToSend = toSend.cryptoAtoms
|
||||
if (cryptoAtomsToSend === 0) {
|
||||
return cb(null, {statusCode: 204, txId: tx.txId, txHash: null})
|
||||
}
|
||||
|
||||
_sendCoins(tx.toAddress, cryptoUnitsToSend, function (_err, txHash) {
|
||||
_sendCoins(tx.toAddress, cryptoAtomsToSend, function (_err, txHash) {
|
||||
var fee = null // Need to fill this out in plugins
|
||||
if (_err) toSend = {cryptoUnits: new BigNumber(0), fiat: 0}
|
||||
if (_err) toSend = {cryptoAtoms: new BigNumber(0), fiat: 0}
|
||||
db.sentCoins(session, tx, authority, toSend, fee, _err, txHash)
|
||||
|
||||
if (_err) return cb(_err)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue