Update with more debug states

This commit is contained in:
Alexander Blair
2017-03-07 17:16:04 -08:00
parent b3bb5a6cdf
commit 6da367c587
3 changed files with 15 additions and 5 deletions
+2 -1
View File
@@ -117,7 +117,7 @@ sock.on('message', function(topic, message) {
});
break;
case 'network_block_info':
io.sockets.in('block_update').emit('message', JSON.stringify(global.database.getCache('networkBlockInfo')));
io.sockets.in('block_update').emit('message', message);
break;
case 'pool_stats':
if (message === 'global'){
@@ -145,6 +145,7 @@ sock.on('message', function(topic, message) {
case 'default':
io.sockets.in('pool_stats_' + message).emit('message', JSON.stringify({'error': 'Invalid pool type'}));
}
localCache.poolType = pool_type;
delete(localCache.minerHistory);
delete(localCache.hashHistory);
io.sockets.in('pool_stats_' + message).emit('message', JSON.stringify({pool_statistics: localCache}));
+8 -2
View File
@@ -177,7 +177,7 @@ function updateShareStats() {
if (globalMinerList.indexOf(miner) === -1) {
globalMinerList.push(miner);
}
if (miner.indexOf('-') === -1){
if (miner.indexOf('_') === -1){
activeAddresses.push(miner);
}
let cachedData = global.database.getCache(miner);
@@ -440,7 +440,13 @@ function updateBlockHeader() {
value: body.result.block_header.reward,
ts: body.result.block_header.timestamp
});
sock.send(['network_block_info', 'complete']);
sock.send(['network_block_info', JSON.stringify({
difficulty: body.result.block_header.difficulty,
hash: body.result.block_header.hash,
height: body.result.block_header.height,
value: body.result.block_header.reward,
ts: body.result.block_header.timestamp
})]);
} else {
console.error("GetLastBlockHeader Error during block header update");
}