diff --git a/models/node.js b/models/node.js index c30f19f..7acacdd 100644 --- a/models/node.js +++ b/models/node.js @@ -49,7 +49,7 @@ Node.prototype.update = function() if(this.info.stats.peers != null) { this.info.stats.block = eth.block(parseInt(eth.number)); - if(this.info.stats.block.hash != '?'){ + if(this.info.stats.block.hash != '?' && typeof this.info.stats.block.difficulty !== 'undefined'){ this.info.stats.block.difficulty = this.web3.toDecimal(this.info.stats.block.difficulty); } this.info.stats.mining = eth.mining; @@ -65,4 +65,4 @@ Node.prototype.update = function() return this.info; }; -module.exports = Node; \ No newline at end of file +module.exports = Node;