Conversation
290117f to
b2107ed
Compare
ee685d0 to
fca1489
Compare
) The 'difficulty' field in getmininginfo RPC was always returning Groestl's difficulty (algo=2) instead of the current mining algorithm's difficulty. Root cause: During Bitcoin Core v26.2 merge, the miningAlgo parameter was lost from the GetDifficulty() call, causing it to default to Groestl. Changes: - src/rpc/mining.cpp: Restore miningAlgo parameter to GetDifficulty() - test/functional: Add regression test for issue #346 - doc/ai: Move AI-generated PR documentation to dedicated directory - ci: Fix macOS hashFiles() failure in Homebrew cache (GitHub #4134) Fixes #346 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
fca1489 to
9f77a4d
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fix: getmininginfo difficulty field always returns Groestl difficulty (Issue #346)
Summary
Fixes #346 - The
difficultyfield ingetmininginfoRPC was returning a frozen/incorrect value because it was always querying Groestl's difficulty instead of the current mining algorithm's difficulty.Problem Description
In DigiByte v8.26.1, users reported that the
difficultyfield in thegetmininginfoRPC method displays a frozen value that doesn't update correctly. Thedifficultiesfield (plural) works as expected, but the singulardifficultyfield was broken.Root Cause
During the Bitcoin Core v26.2 merge, the
GetDifficulty()call ingetmininginfolost the algorithm parameter.In v8.22.2 (working):
In v8.26.1 (broken):
Since DigiByte's
GetDifficulty()function signature is:When called with only one parameter,
algodefaults to2(ALGO_GROESTL), causing it to always return Groestl's difficulty regardless of the user's configured mining algorithm.Changes Made
src/rpc/mining.cppminingAlgoparameter to theGetDifficulty()callGetDifficulty(tip)→GetDifficulty(tip, nullptr, miningAlgo)Testing
This fix ensures that:
difficultyfield returns the difficulty for the current mining algorithm (as set by-miningalgo)Test commands:
Impact
Additional Context
This is a regression introduced during the Bitcoin Core v26.2 merge. It highlights the importance of preserving DigiByte-specific multi-algorithm functionality when integrating upstream Bitcoin changes. The
difficultiesfield was unaffected because it explicitly iterates through all algorithms with the correct parameters.Repository:
DigiByte-Core/digibyteBranch:
claude/investigate-digibyte-issue-018eRW2M8brZzweTZpj1e89BTarget:
developCommit: c6f3663
Create PR Link: