angular improvements

This commit is contained in:
cubedro
2015-06-09 12:39:13 +03:00
parent d9ae085890
commit 4b5bdf3e3e
6 changed files with 73 additions and 35 deletions

View File

@@ -71,24 +71,22 @@ History.prototype.add = function(block, id)
if(historyBlock.hash !== block.hash || historyBlock.totalDifficulty !== block.totalDifficulty || historyBlock.transactions.length !== block.transactions.length)
{
index = _.findIndex( this._items, { height: block.number } );
this._items[index].hash = block.hash;
this._items[index].parentHash = block.parentHash;
this._items[index].nonce = block.nonce;
this._items[index].sha3Uncles = block.sha3Uncles;
this._items[index].transactionsRoot = block.transactionsRoot;
this._items[index].stateRoot = block.stateRoot;
this._items[index].miner = block.miner;
this._items[index].difficulty = block.difficulty;
this._items[index].totalDifficulty = block.totalDifficulty;
this._items[index].size = block.size;
this._items[index].extraData = block.extraData;
this._items[index].gasLimit = block.gasLimit;
this._items[index].gasUsed = block.gasUsed;
this._items[index].timestamp = block.timestamp;
this._items[index].transactions = block.transactions;
this._items[index].uncles = block.uncles;
historyBlock.hash = block.hash;
historyBlock.parentHash = block.parentHash;
historyBlock.nonce = block.nonce;
historyBlock.sha3Uncles = block.sha3Uncles;
historyBlock.transactionsRoot = block.transactionsRoot;
historyBlock.stateRoot = block.stateRoot;
historyBlock.miner = block.miner;
historyBlock.difficulty = block.difficulty;
historyBlock.totalDifficulty = block.totalDifficulty;
historyBlock.size = block.size;
historyBlock.extraData = block.extraData;
historyBlock.gasLimit = block.gasLimit;
historyBlock.gasUsed = block.gasUsed;
historyBlock.timestamp = block.timestamp;
historyBlock.transactions = block.transactions;
historyBlock.uncles = block.uncles;
changed = true;
}