Repository navigation
Report getmininginfo networkhashps over the getnetworkhashps window. - #1246
Merged
evoskuil merged 1 commit intoNov 28, 2026
Merged
Conversation
evoskuil
reviewed
Nov 28, 2026
evoskuil
left a comment
Member
There was a problem hiding this comment.
Looks correct. Both getmininginfo handlers now report over the same window as getnetworkhashps at its defaults (120 blocks ending at the confirmed top), which is what bitcoind and btcd do, and getnetworkhashps behavior is unchanged. Minor notes, none blocking:
- The commit message has a body; the repos use a single subject line.
hash_ps_window = 120duplicates the default declared ininterfaces/bitcoind_mining.hpp(nullopt<120.0>), so the two can drift.- Statics go at the top of their section; the new
static constexprsits between an override and a method. network_hash_pscan beconst(archive()is const).- The btcd endpoint takes Core's min/max timestamp span rather than btcd's first/last block timestamps. Immaterial for a normal window.
eynhaender
force-pushed
the
fix/mininginfo-networkhashps
branch
from
November 28, 2026 19:51
9457164 to
c2d4fe9
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.
getmininginfo.networkhashpswas computed as difficulty * 2^32 / block spacing, which is the hash rate implied by the current target rather than the observed rate. Both bitcoind and btcd answer this field withgetnetworkhashpsat its defaults (120 blocks ending at the top).getnetworkhashpswindow calculation intoprotocol_bitcoind_mining::network_hash_ps();getnetworkhashpsbehavior is unchanged.getmininginfohandlers, with the window taken from thegetnetworkhashpsinterface default.getmininginfo.networkhashpsequals the defaultgetnetworkhashpson both endpoints.