Merge pull request #41 from cubedro/develop

Fixed propagation best block bug
This commit is contained in:
Marian OANCΞA 2015-04-05 19:31:01 +03:00
commit 14db677e7a
2 changed files with 1 additions and 6 deletions

View File

@ -38,7 +38,7 @@ Collection.prototype.update = function(id, stats)
{ {
stats.block.received = (new Date()).getTime(); stats.block.received = (new Date()).getTime();
if(this._bestBlock.number < oldStats.stats.block.number) if(this._bestBlock.number < stats.block.number)
{ {
stats.block.propagation = 0; stats.block.propagation = 0;
this._bestBlock = stats.block; this._bestBlock = stats.block;

View File

@ -90,11 +90,6 @@ Node.prototype.setStats = function(stats)
{ {
if(typeof stats !== 'undefined' && typeof stats.block !== 'undefined' && typeof stats.block.number !== 'undefined') if(typeof stats !== 'undefined' && typeof stats.block !== 'undefined' && typeof stats.block.number !== 'undefined')
{ {
// if(stats.block.number !== this.stats.block.number) {
// stats.block.received = (new Date()).getTime();
// } else {
// stats.block.received = this.stats.block.received;
// }
stats.block.hash = stats.block.hash.replace('0x', ''); stats.block.hash = stats.block.hash.replace('0x', '');
this.stats = stats; this.stats = stats;