Fix for incorrect equihash and cryptonight block headers response#133
Fix for incorrect equihash and cryptonight block headers response#133jimmypound wants to merge 2 commits intoproject-bitmark:masterfrom
Conversation
…of boost::bind()" This reverts commit 2669119.
…ihash and cryptonight blocks when "getheaders" are requested.
There was a problem hiding this comment.
Pull request overview
This PR fixes a critical bug where Bitmark nodes return incorrect block headers for equihash and cryptonight blocks when "getheaders" requests are processed. It also reverts a previous commit that broke the build by incorrectly using std::placeholders with boost::bind.
Key changes:
- Adds missing field assignments (nNonce256, nSolution, hashReserved) to block header construction methods
- Ensures equihash and cryptonight block headers are correctly populated when loaded from disk
- Reverts boost::bind placeholder changes from
std::placeholders::_Nto_N(global namespace placeholders)
Reviewed changes
Copilot reviewed 7 out of 7 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| src/txdb.cpp | Adds missing assignments of nNonce256, nSolution, and hashReserved fields when loading block index from disk; fixes whitespace |
| src/core.h | Updates CBlock::GetBlockHeader() and CBlockIndex::GetBlockHeader() to include nNonce256, nSolution, and hashReserved fields |
| src/qt/walletmodel.cpp | Reverts boost::bind placeholders from std::placeholders to global namespace (_1, _2, etc.) |
| src/qt/splashscreen.cpp | Reverts boost::bind placeholders from std::placeholders to global namespace |
| src/qt/clientmodel.cpp | Reverts boost::bind placeholders from std::placeholders to global namespace |
| src/qt/bitmarkgui.cpp | Reverts boost::bind placeholders from std::placeholders to global namespace |
| src/main.cpp | Reverts boost::bind placeholders from std::placeholders to global namespace |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| block.nNonce256 = nNonce256; | ||
| block.nSolution = nSolution; | ||
| block.hashReserved = hashReserved; |
There was a problem hiding this comment.
Inconsistent whitespace: These lines use tabs while the surrounding code uses spaces for indentation. The whitespace should match the existing code style.
| block.nNonce256 = nNonce256; | |
| block.nSolution = nSolution; | |
| block.hashReserved = hashReserved; | |
| block.nNonce256 = nNonce256; | |
| block.nSolution = nSolution; | |
| block.hashReserved = hashReserved; |
| block.nNonce256 = nNonce256; | ||
| block.nSolution = nSolution; | ||
| block.hashReserved = hashReserved; |
There was a problem hiding this comment.
Inconsistent whitespace: These lines use tabs while the surrounding code uses spaces for indentation. The whitespace should match the existing code style.
| pindexNew->nNonce256 = diskindex.nNonce256; | ||
| pindexNew->nSolution = diskindex.nSolution; | ||
| pindexNew->hashReserved = diskindex.hashReserved; |
There was a problem hiding this comment.
Inconsistent whitespace: These lines use tabs while the surrounding code uses spaces for indentation. The whitespace should match the existing code style, which appears to use spaces based on the surrounding lines.
This PR: