06082026/cnodestate copy - #5
Open
Crypt-iQ wants to merge 3 commits into
Open
Conversation
Crypt-iQ
force-pushed
the
06082026/cnodestate_copy
branch
from
August 25, 2026 14:56
58ffc6c to
f45c78a
Compare
Both m_requested_hb_cmpctblocks & m_provides_cmpctblocks were protected by cs_main which is unnecessary. Instead convert them to std::atomic<bool> as Mutex is not needed. This way we don't need to worry about potential lock inversion in the future or thread safety annotations. Also, add a negative annotation to NewPoWValidBlock for m_peer_mutex since it now acquires it.
Also make the m_num_preferred_download_peers counter atomic and add an assert in FinalizeNode. The asserts for m_num_preferred_download_peers in FinalizeNode are still safe even without cs_main locking because of the implicit guarantee that ProcessMessage may not run for a peer at the same time as FinalizeNode. This has the nice benefit of being able to remove cs_main usage in some places.
-BEGIN VERIFY SCRIPT- sed -i "s/fPreferredDownload/m_preferred_download/g" $( git grep -l fPreferredDownload ) -END VERIFY SCRIPT-
Crypt-iQ
force-pushed
the
06082026/cnodestate_copy
branch
from
August 25, 2026 14:57
f45c78a to
7e5a5a7
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.
No description provided.