diff --git a/lib/cash-out-tx.js b/lib/cash-out-tx.js index 49d315aa..96352510 100644 --- a/lib/cash-out-tx.js +++ b/lib/cash-out-tx.js @@ -189,13 +189,12 @@ function preProcess (tx, newTx, pi) { } function postProcess (txVector, pi) { - const [oldTx, newTx] = txVector - - if (!oldTx) pi.sell(newTx) + const [, newTx] = txVector if (newTx.dispensed && !newTx.bills) { return pi.buildCartridges() .then(cartridges => { + pi.sell(newTx) return _.set('bills', billMath.makeChange(cartridges.cartridges, newTx.fiat), newTx) }) }