Skip to content

Commit

Permalink
Adaprt diff to coin algo during switch
Browse files Browse the repository at this point in the history
  • Loading branch information
MoneroOcean committed Feb 8, 2019
1 parent c765a3c commit 7439e55
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lib/pool.js
Original file line number Diff line number Diff line change
Expand Up @@ -713,8 +713,8 @@ function Miner(id, login, pass, ipAddress, startingDiff, messageSender, protoVer
if (typeof(this.curr_coin) === 'undefined' || this.curr_coin != best_coin) {
if (this.debugMiner) {
console.log(threadName + this.logString + ": miner has " + this.hashes + " hashes");
if (this.hashes && this.curr_coin) this.hashes *= this.coin_perf[best_coin] / this.coin_perf[this.curr_coin];
this.setNewDiff(this.calcNewDiff());
if (this.hashes && typeof(this.curr_coin) !== 'undefined') this.hashes *= this.coin_perf[best_coin] / this.coin_perf[this.curr_coin];
this.setNewDiff(this.calcNewDiff());
console.log(threadName + this.logString + ": miner now has " + this.hashes + " hashes");
}
this.curr_coin = best_coin;
Expand Down

2 comments on commit 7439e55

@pr0vieh
Copy link

@pr0vieh pr0vieh commented on 7439e55 Feb 8, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

addressed in #77 🎉

@MoneroOcean
Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, cn-pico finally urged me to do this. Currently this code works on jp MO node. Will apply it to others after some testing.

Please sign in to comment.