Skip to content

Commit e661c2f

Browse files
committed
Do not switch from current algo if it is less than 5 percent profitable
1 parent db94117 commit e661c2f

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

lib/pool.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -704,12 +704,14 @@ function Miner(id, login, pass, ipAddress, startingDiff, messageSender, protoVer
704704
}
705705
let best_algo = "";
706706
let best_algo_perf = this.algos_perf[""];
707+
if (this.curr_algo === "") best_algo_perf *= 1.05;
707708
let miner = this;
708709
ALGOS.forEach(function(algo) {
709710
if (!(algo in activeBlockTemplate)) return;
710711
const port = activeBlockTemplate[algo].port;
711712
if (!(global.coinFuncs.algoTypeStr(port) in miner.algos) && !(global.coinFuncs.algoShortTypeStr(port) in miner.algos)) return;
712-
const algoHashFactor = global.config.daemon["algoHashFactor" + algo];
713+
let algoHashFactor = global.config.daemon["algoHashFactor" + algo];
714+
if (this.curr_algo === algo) algoHashFactor *= 1.05;
713715
if (algo in miner.algos_perf && miner.algos_perf[algo] * algoHashFactor > best_algo_perf) {
714716
debug(miner.logString + ": " + algo + ": " + miner.algos_perf[algo] * algoHashFactor);
715717
best_algo = algo;

0 commit comments

Comments
 (0)