From 52a2ae6047fb946f5016d64f07a01139b5aff87d Mon Sep 17 00:00:00 2001 From: Ivan Socolsky Date: Thu, 19 Mar 2015 13:17:51 -0300 Subject: [PATCH] tx.time defaults to now --- lib/server.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/server.js b/lib/server.js index eea6bf6..6aa9293 100644 --- a/lib/server.js +++ b/lib/server.js @@ -952,6 +952,7 @@ WalletService.prototype.getTxHistory = function(opts, cb) { }); }; + var now = Math.floor(Date.now() / 1000); return _.map(txs, function(tx) { var inputs = classify(tx.inputs); @@ -979,7 +980,7 @@ WalletService.prototype.getTxHistory = function(opts, cb) { action: action, amount: amount, fees: tx.fees, - time: tx.time, + time: tx.time || now, addressTo: addressTo, confirmations: tx.confirmations, }; @@ -1003,7 +1004,6 @@ WalletService.prototype.getTxHistory = function(opts, cb) { function paginate(txs) { var limited = opts.limit && opts.limit != -1; - if (!opts.minTs && !opts.maxTs && !limited) return; var minTs = opts.minTs || 0; var maxTs = opts.maxTs || Math.ceil(Date.now() / 1000);