mirror of
https://github.com/jwinterm/nodejs-pool.git
synced 2026-12-02 11:54:01 +01:00
Update with more debug states
This commit is contained in:
@@ -5,11 +5,14 @@
|
|||||||
var socket = io.connect('https://api.xmrpool.net/');
|
var socket = io.connect('https://api.xmrpool.net/');
|
||||||
|
|
||||||
// let's assume that the client page, once rendered, knows what room it wants to join
|
// let's assume that the client page, once rendered, knows what room it wants to join
|
||||||
var room = "pool_stats";
|
|
||||||
|
|
||||||
socket.on('connect', function() {
|
socket.on('connect', function() {
|
||||||
// Connected, let's sign-up for to receive messages for this room
|
// Connected, let's sign-up for to receive messages for this room
|
||||||
socket.emit('room', room);
|
socket.emit('room', "pool_stats");
|
||||||
|
socket.emit('room', "pool_stats_pplns");
|
||||||
|
socket.emit('room', "pool_stats_solo");
|
||||||
|
socket.emit('room', "network_block_info");
|
||||||
|
socket.emit('room', "address_stats_46XWBqE1iwsVxSDP1qDrxhE1XvsZV6eALG5LwnoMdjbT4GPdy2bZTb99kagzxp2MMjUamTYZ4WgvZdFadvMimTjvR6Gv8hL")
|
||||||
});
|
});
|
||||||
|
|
||||||
socket.on('message', function(data) {
|
socket.on('message', function(data) {
|
||||||
|
|||||||
+2
-1
@@ -117,7 +117,7 @@ sock.on('message', function(topic, message) {
|
|||||||
});
|
});
|
||||||
break;
|
break;
|
||||||
case 'network_block_info':
|
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;
|
break;
|
||||||
case 'pool_stats':
|
case 'pool_stats':
|
||||||
if (message === 'global'){
|
if (message === 'global'){
|
||||||
@@ -145,6 +145,7 @@ sock.on('message', function(topic, message) {
|
|||||||
case 'default':
|
case 'default':
|
||||||
io.sockets.in('pool_stats_' + message).emit('message', JSON.stringify({'error': 'Invalid pool type'}));
|
io.sockets.in('pool_stats_' + message).emit('message', JSON.stringify({'error': 'Invalid pool type'}));
|
||||||
}
|
}
|
||||||
|
localCache.poolType = pool_type;
|
||||||
delete(localCache.minerHistory);
|
delete(localCache.minerHistory);
|
||||||
delete(localCache.hashHistory);
|
delete(localCache.hashHistory);
|
||||||
io.sockets.in('pool_stats_' + message).emit('message', JSON.stringify({pool_statistics: localCache}));
|
io.sockets.in('pool_stats_' + message).emit('message', JSON.stringify({pool_statistics: localCache}));
|
||||||
|
|||||||
+8
-2
@@ -177,7 +177,7 @@ function updateShareStats() {
|
|||||||
if (globalMinerList.indexOf(miner) === -1) {
|
if (globalMinerList.indexOf(miner) === -1) {
|
||||||
globalMinerList.push(miner);
|
globalMinerList.push(miner);
|
||||||
}
|
}
|
||||||
if (miner.indexOf('-') === -1){
|
if (miner.indexOf('_') === -1){
|
||||||
activeAddresses.push(miner);
|
activeAddresses.push(miner);
|
||||||
}
|
}
|
||||||
let cachedData = global.database.getCache(miner);
|
let cachedData = global.database.getCache(miner);
|
||||||
@@ -440,7 +440,13 @@ function updateBlockHeader() {
|
|||||||
value: body.result.block_header.reward,
|
value: body.result.block_header.reward,
|
||||||
ts: body.result.block_header.timestamp
|
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 {
|
} else {
|
||||||
console.error("GetLastBlockHeader Error during block header update");
|
console.error("GetLastBlockHeader Error during block header update");
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user