remove toSend partial send stuff

This commit is contained in:
Josh Harvey 2016-05-25 16:57:02 +03:00
parent 59db6d803c
commit ec2f925c16

View file

@ -277,20 +277,17 @@ function _sendCoins (toAddress, cryptoAtoms, cryptoCode, cb) {
} }
function executeTx (session, tx, authority, cb) { function executeTx (session, tx, authority, cb) {
db.addOutgoingTx(session, tx, function (err, toSend) { db.addOutgoingTx(session, tx, function (err) {
if (err) { if (err) {
logger.error(err) logger.error(err)
return cb(err) return cb(err)
} }
var cryptoAtomsToSend = toSend.cryptoAtoms
if (cryptoAtomsToSend.eq(0)) {
logger.debug('No cryptoAtoms to send')
return cb(null, {statusCode: 204, txId: tx.txId, txHash: null})
}
var cryptoCode = tx.cryptoCode var cryptoCode = tx.cryptoCode
_sendCoins(tx.toAddress, cryptoAtomsToSend, cryptoCode, function (_err, txHash) { _sendCoins(tx.toAddress, tx.cryptoAtoms, cryptoCode, function (_err, txHash) {
var fee = null // Need to fill this out in plugins var fee = null // Need to fill this out in plugins
var toSend = {cryptoAtoms: tx.cryptoAtoms, fiat: tx.fiat}
if (_err) { if (_err) {
logger.error(_err) logger.error(_err)
toSend = {cryptoAtoms: new BigNumber(0), fiat: 0} toSend = {cryptoAtoms: new BigNumber(0), fiat: 0}