added block arrival time and propagation time

This commit is contained in:
cubedro 2015-02-23 18:48:53 +02:00
parent f3fdabf0be
commit b7ce4ddf2b

View File

@ -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')
{