diff --git a/lib/transactions.js b/lib/transactions.js index fb1ed0599..b5a6fc635 100644 --- a/lib/transactions.js +++ b/lib/transactions.js @@ -1,6 +1,7 @@ 'use strict'; var bitcore = require('bitcore'); +var _ = bitcore.deps._; var common = require('./common'); var async = require('async'); @@ -31,7 +32,7 @@ TxController.prototype.transaction = function(req, res, next, txid) { if(err) { return res.send({ error: err.toString() - }) + }); } req.transaction = self.transformTransaction(transaction); @@ -206,7 +207,7 @@ TxController.prototype.list = function(req, res) { var txs = block.transactions; var totalTxs = txs.length; - if(page) { + if(!_.isUndefined(page)) { txs = txs.splice(page * pageLength, pageLength); pagesTotal = Math.ceil(totalTxs / pageLength); } @@ -275,4 +276,4 @@ TxController.prototype.send = function(req, res) { }); }; -module.exports = TxController; \ No newline at end of file +module.exports = TxController;