mirror of
https://github.com/jwinterm/nodejs-pool.git
synced 2026-10-17 05:21:27 +02:00
Merge pull request #73 from Snipa22/develop
Fixes roundHashes not resetting
This commit is contained in:
+5
-16
@@ -206,7 +206,7 @@ function Database(){
|
||||
if (!cachedData.global_stats.hasOwnProperty('totalHashes') || cachedData.global_stats.totalHashes === null) {
|
||||
cachedData.global_stats.totalHashes = 0;
|
||||
}
|
||||
if (!cachedData.global_stats.hasOwnProperty('roundHashes') || cachedData.global_stats.roundHashes === null) {
|
||||
if (!cachedData.global_stats.hasOwnProperty('roundHashes') || cachedData.global_stats.roundHashes === null || share.foundBlock) {
|
||||
cachedData.global_stats.roundHashes = 0;
|
||||
}
|
||||
cachedData.global_stats.totalHashes += share.shares;
|
||||
@@ -226,7 +226,7 @@ function Database(){
|
||||
if (!cachedData[stats_type].hasOwnProperty('totalHashes') || cachedData[stats_type].totalHashes === null) {
|
||||
cachedData[stats_type].totalHashes = 0;
|
||||
}
|
||||
if (!cachedData[stats_type].hasOwnProperty('roundHashes') || cachedData[stats_type].roundHashes === null) {
|
||||
if (!cachedData[stats_type].hasOwnProperty('roundHashes') || cachedData[stats_type].roundHashes === null || share.foundBlock) {
|
||||
cachedData[stats_type].roundHashes = 0;
|
||||
}
|
||||
cachedData[stats_type].totalHashes += share.shares;
|
||||
@@ -277,7 +277,7 @@ function Database(){
|
||||
if (shares.hasOwnProperty(key)){
|
||||
blocksSeen += 1;
|
||||
let sharesSeen = 0;
|
||||
shares[key].forEach(function(final_share){
|
||||
shares[key].forEach(function(final_share){ // jshint ignore:line
|
||||
sharesSeen += 1;
|
||||
try {
|
||||
txn.putBinary(global.database.shareDB, parseInt(key), global.protos.Share.encode(final_share));
|
||||
@@ -478,7 +478,7 @@ function Database(){
|
||||
let blockProto = txn.getBinary(this.blockDB, blockId);
|
||||
if (blockProto !== null){
|
||||
let blockData = global.protos.Block.decode(blockProto);
|
||||
blockData['unlocked'] = false;
|
||||
blockData.unlocked = false;
|
||||
txn.putBinary(this.blockDB, blockId, global.protos.Block.encode(blockData));
|
||||
}
|
||||
txn.commit();
|
||||
@@ -618,18 +618,7 @@ function Database(){
|
||||
};
|
||||
|
||||
|
||||
this.refreshEnv = function(){
|
||||
if (this.dirtyenv === true){
|
||||
/*
|
||||
console.log("Database Worker: Reloading LMDB Env");
|
||||
global.database.env.sync(function(){
|
||||
});
|
||||
clearInterval(this.intervalID);
|
||||
global.database.env.close();
|
||||
this.initEnv();
|
||||
*/
|
||||
}
|
||||
};
|
||||
this.refreshEnv = function(){};
|
||||
|
||||
setInterval(function(){
|
||||
global.database.dirtyenv = true;
|
||||
|
||||
+4
-2
@@ -20,13 +20,11 @@
|
||||
"concat-stream": "^1.6.0",
|
||||
"cors": "^2.8.1",
|
||||
"crypto": "0.0.3",
|
||||
"cryptonote-util": "git://github.com/Snipa22/node-cryptonote-util.git#xmr-Nan-2.0",
|
||||
"debug": "2.5.1",
|
||||
"express": "4.14.0",
|
||||
"jsonwebtoken": "^7.2.1",
|
||||
"minimist": "1.2.0",
|
||||
"moment": "2.17.1",
|
||||
"multi-hashing": "git+https://github.com/Snipa22/node-multi-hashing-aesni.git",
|
||||
"mysql": "2.12.0",
|
||||
"node-lmdb": "0.4.12",
|
||||
"promise-mysql": "3.0.0",
|
||||
@@ -42,5 +40,9 @@
|
||||
"uuid": "3.0.1",
|
||||
"wallet-address-validator": "0.1.0",
|
||||
"zmq": "^2.15.3"
|
||||
},
|
||||
"optionalDependencies": {
|
||||
"cryptonote-util": "git://github.com/Snipa22/node-cryptonote-util.git#xmr-Nan-2.0",
|
||||
"multi-hashing": "git+https://github.com/Snipa22/node-multi-hashing-aesni.git"
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user