Skip to content

Fix proxy miner diff calculation and unify proxy target handling in miner diff logic#170

Merged
MoneroOcean merged 1 commit into
masterfrom
codex/fix-proxy-aggregate-difficulty-calculation
May 22, 2026
Merged

Fix proxy miner diff calculation and unify proxy target handling in miner diff logic#170
MoneroOcean merged 1 commit into
masterfrom
codex/fix-proxy-aggregate-difficulty-calculation

Conversation

@MoneroOcean
Copy link
Copy Markdown
Owner

Motivation

  • Correct proxy miner hash-rate detection which previously mixed milliseconds and seconds and used a raw hashes/time comparison that could be incorrect.
  • Ensure proxy detection compares a properly computed proxy hash-rate against miner.difficulty and avoids division-by-zero.
  • Consolidate the hardcoded proxy target value into a single proxyTarget for consistent retarget behavior.

Description

  • Introduced a proxyTarget constant and compute proxyDiff as proxyMiner.hashes * proxyTarget / proxyPeriod with proxyPeriod in seconds and guarded by proxyPeriod > 0.
  • Switched proxy detection to if (proxyMiner && proxyDiff > miner.difficulty) and use proxyTarget when assigning target for proxy-related branches and throttled wallets.
  • Updated the miner.proxy branch to use proxyTarget as the target and left existing minDiff and historyTime logic intact while initializing proxyDiff to zero.

Testing

  • Ran unit tests with npm test and they passed.
  • Ran linter with npm run lint and it passed.
  • No automated test failures were observed.

Codex Task

@MoneroOcean MoneroOcean merged commit 7ad3aec into master May 22, 2026
2 checks passed
@MoneroOcean MoneroOcean deleted the codex/fix-proxy-aggregate-difficulty-calculation branch May 22, 2026 21:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant