From b7ce4ddf2b996a8da064a4373fa1478802993c32 Mon Sep 17 00:00:00 2001 From: cubedro Date: Mon, 23 Feb 2015 18:48:53 +0200 Subject: [PATCH] added block arrival time and propagation time --- lib/node.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/lib/node.js b/lib/node.js index 8cd766f..6eedfd9 100644 --- a/lib/node.js +++ b/lib/node.js @@ -137,7 +137,8 @@ Node.prototype.getBlock = function(number) number: 0, hash: '?', difficulty: 0, - timestamp: 0 + timestamp: 0, + arrival: 0 }; if(typeof number === 'undefined'){ @@ -157,6 +158,8 @@ Node.prototype.getBlock = function(number) try { block = web3.eth.block(number); + block.arrival = Math.floor(Date.now()/1000); + block.propagation = block.arrival - block.timestamp; if(block.hash != '?' && typeof block.difficulty !== 'undefined') {