Skip to content

Conversation

@jimmypound
Copy link

This PR:

  • reverts commit 2669119 because it breaks the build
  • fixes bug where Bitmark node returns incorrect block headers for equihash and cryptonight blocks when "getheaders" are requested. This is not the issue for bitmark v.0.9.7 because nodes do not use "getheaders" for chain sync. It creates a problem for the newer version where chain sync is conducted in two phases. In the first phase, headers are fetched, and if headers are correct then whole blocks are requested.

…ihash and cryptonight blocks when "getheaders" are requested.
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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::_N to _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.

Comment on lines +754 to +756
block.nNonce256 = nNonce256;
block.nSolution = nSolution;
block.hashReserved = hashReserved;
Copy link

Copilot AI Jan 9, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Inconsistent whitespace: These lines use tabs while the surrounding code uses spaces for indentation. The whitespace should match the existing code style.

Suggested change
block.nNonce256 = nNonce256;
block.nSolution = nSolution;
block.hashReserved = hashReserved;
block.nNonce256 = nNonce256;
block.nSolution = nSolution;
block.hashReserved = hashReserved;

Copilot uses AI. Check for mistakes.
Comment on lines +971 to +973
block.nNonce256 = nNonce256;
block.nSolution = nSolution;
block.hashReserved = hashReserved;
Copy link

Copilot AI Jan 9, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Inconsistent whitespace: These lines use tabs while the surrounding code uses spaces for indentation. The whitespace should match the existing code style.

Copilot uses AI. Check for mistakes.
Comment on lines +224 to +226
pindexNew->nNonce256 = diskindex.nNonce256;
pindexNew->nSolution = diskindex.nSolution;
pindexNew->hashReserved = diskindex.hashReserved;
Copy link

Copilot AI Jan 9, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Copilot uses AI. Check for mistakes.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant