From eb4c1fda03141cd3c18a9276b599af72a4b6c7d3 Mon Sep 17 00:00:00 2001 From: Matias Alejo Garcia Date: Wed, 28 Oct 2015 17:46:36 -0300 Subject: [PATCH] use blocktime if present --- lib/server.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/lib/server.js b/lib/server.js index 7650f88..c699a5a 100644 --- a/lib/server.js +++ b/lib/server.js @@ -1701,11 +1701,15 @@ WalletService.prototype._normalizeTxHistory = function(txs) { } }); + var t = tx.time; // blocktime + if (!t || _.isNaN(t)) t = tx.firstSeenTs; + if (!t || _.isNaN(t)) t = now; + return { txid: tx.txid, confirmations: tx.confirmations, fees: parseInt((tx.fees * 1e8).toFixed(0)), - time: tx.firstSeenTs || (!_.isNaN(tx.time) ? tx.time : now) || now, + time: t, inputs: inputs, outputs: outputs, };