Slow down some of the network updates.

This commit is contained in:
Alexander Blair
2017-03-07 17:28:39 -08:00
parent 6da367c587
commit 657a46db4d
3 changed files with 31 additions and 17 deletions
+3 -1
View File
@@ -8,6 +8,7 @@ const sock = zmq.socket('pub');
let threadName = "Worker Server ";
let cycleCount = 0;
sock.bindSync('tcp://127.0.0.1:3000');
let lastBlockHash = null;
function updateShareStats() {
// This is an omni-worker to deal with all things share-stats related
@@ -432,7 +433,8 @@ function updatePoolInformation() {
function updateBlockHeader() {
global.support.rpcDaemon('getlastblockheader', [], function (body) {
if (body.result) {
if (body.result && body.result.block_header.hash !== lastBlockHash) {
lastBlockHash = body.result.block_header.hash;
global.database.setCache('networkBlockInfo', {
difficulty: body.result.block_header.difficulty,
hash: body.result.block_header.hash,