-
Notifications
You must be signed in to change notification settings - Fork 38.7k
Replace HexBits with strprintf #4422
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
src/miner.cpp
Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not that I care much about this debug output line but you're aware pblock->nBits is not the same as hashTarget?
|
@sipa I assumed HexStr(pblock->nBits) was going to be equivalent to uint256().SetCompact(pblock->nBits).GetHex() but I didn't tested the output. I can leave as it was. @laanwj using strprintf("%08x", nBits) to replace HexBits instead of defining the new specialized HexStr seems better (less additions, the same deletions) if the outputs are equivalent. Would this serve for the case sipa is discussing too? Either way seems better to remove HexBits, which is just too specific. |
|
@jtimon No, it wouldn't address sipa's problem. Let's leave the line in CheckWork as it is, as I see it it doesn't even use hexbits? |
|
No, it doesn't, I thought that could be a use outside of the rpc stuff, but yeah, I'll just leave it as it was. |
|
OK! |
|
Untested ACK. |
|
Yep, this won't show up on the automatic tests so it will need to be tested manually. |
|
u-t ACK |
|
Tested both functions in an independent program and they produce the same results. |
|
ACK |
|
Automatic sanity-testing: PASSED, see http://jenkins.bluematt.me/pull-tester/p4422_645d497aa0010525441ce409e8e6d327a157ab39/ for binaries and test log. |
645d497 Replace HexBits with strprintf (jtimon)
Get rid of HexBits.