Switch vardiff.mode to safe by default.
This commit is contained in:
parent
5b0c39e840
commit
79c1a95b59
@ -126,9 +126,12 @@ var pool = stratum.createPool({
|
|||||||
retargetTime: 120, //check to see if we should retarget every this many seconds
|
retargetTime: 120, //check to see if we should retarget every this many seconds
|
||||||
variancePercent: 20 //allow average time to very this % from target without retarget
|
variancePercent: 20 //allow average time to very this % from target without retarget
|
||||||
|
|
||||||
/* Enabling this option will queue client difficulty updates to be sent when a new job
|
/* By default new difficulties will be sent when a new job is available as stratum
|
||||||
is available. Otherwise new difficulties will be sent immediately. */
|
protocol (http://mining.bitcoin.cz/stratum-mining) states that new difficulties
|
||||||
//mode: 'safe'
|
"will be applied to every next job received from the server." Some miner software
|
||||||
|
will almost immediately apply new difficulties. Set mode to fast for difficulty
|
||||||
|
to be sent immediately. */
|
||||||
|
//mode: 'fast'
|
||||||
}
|
}
|
||||||
|
|
||||||
}, function(ip, workerName, password, callback){ //stratum authorization function
|
}, function(ip, workerName, password, callback){ //stratum authorization function
|
||||||
|
|||||||
@ -48,7 +48,7 @@ var BlockTemplate = module.exports = function BlockTemplate(jobId, rpcData, publ
|
|||||||
}));
|
}));
|
||||||
this.merkleTree = new merkleTree(getTransactionBuffers(rpcData.transactions));
|
this.merkleTree = new merkleTree(getTransactionBuffers(rpcData.transactions));
|
||||||
this.merkleBranch = getMerkleHashes(this.merkleTree.steps);
|
this.merkleBranch = getMerkleHashes(this.merkleTree.steps);
|
||||||
this.generationTransaction = transactions.CreateGeneration(//new transactions.Generation(
|
this.generationTransaction = transactions.CreateGeneration(
|
||||||
rpcData,
|
rpcData,
|
||||||
publicKey,
|
publicKey,
|
||||||
extraNoncePlaceholder,
|
extraNoncePlaceholder,
|
||||||
|
|||||||
18
lib/pool.js
18
lib/pool.js
@ -66,20 +66,20 @@ var pool = module.exports = function pool(options, authorizeFn){
|
|||||||
_this.varDiff = new varDiff(options.varDiff, options.difficulty);
|
_this.varDiff = new varDiff(options.varDiff, options.difficulty);
|
||||||
_this.varDiff.on('newDifficulty', function(client, newDiff) {
|
_this.varDiff.on('newDifficulty', function(client, newDiff) {
|
||||||
|
|
||||||
if (options.varDiff.mode === 'safe'){
|
if (options.varDiff.mode === 'fast'){
|
||||||
/* We request to set the newDiff @ the next difficulty retarget
|
|
||||||
(which should happen when a new job comes in - AKA BLOCK) */
|
|
||||||
client.enqueueNextDifficulty(newDiff);
|
|
||||||
}
|
|
||||||
else{
|
|
||||||
/* Send new difficulty, then force miner to use new diff by resending the
|
/* Send new difficulty, then force miner to use new diff by resending the
|
||||||
current job parameters but with the "clean jobs" flag set to false
|
current job parameters but with the "clean jobs" flag set to false
|
||||||
so the miner doesn't restart work and submit duplicate shares */
|
so the miner doesn't restart work and submit duplicate shares */
|
||||||
client.sendDifficulty(newDiff);
|
client.sendDifficulty(newDiff);
|
||||||
var job = _this.jobManager.currentJob.getJobParams();
|
var job = _this.jobManager.currentJob.getJobParams();
|
||||||
//job[8] = false;
|
job[8] = false;
|
||||||
client.sendMiningJob(job);
|
client.sendMiningJob(job);
|
||||||
}
|
}
|
||||||
|
else{
|
||||||
|
/* We request to set the newDiff @ the next difficulty retarget
|
||||||
|
(which should happen when a new job comes in - AKA BLOCK) */
|
||||||
|
client.enqueueNextDifficulty(newDiff);
|
||||||
|
}
|
||||||
});
|
});
|
||||||
emitLog("system", "VarDiff enabled and setup");
|
emitLog("system", "VarDiff enabled and setup");
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user