Skip to content

06082026/cnodestate copy - #5

Open
Crypt-iQ wants to merge 3 commits into
masterfrom
06082026/cnodestate_copy
Open

06082026/cnodestate copy#5
Crypt-iQ wants to merge 3 commits into
masterfrom
06082026/cnodestate_copy

Conversation

@Crypt-iQ

Copy link
Copy Markdown
Owner

No description provided.

@Crypt-iQ
Crypt-iQ force-pushed the 06082026/cnodestate_copy branch from 58ffc6c to f45c78a Compare August 25, 2026 14:56
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
Crypt-iQ force-pushed the 06082026/cnodestate_copy branch from f45c78a to 7e5a5a7 Compare August 25, 2026 14:57
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