refactor: Move m_num_unconnecting_headers_msgs out of cs_main guard #25555
pull maflcko wants to merge 1 commits into bitcoin:master from maflcko:2207-p2p-less-cs_main-🍘 changing 1 files +18 −19-
maflcko commented at 3:01 pm on July 6, 2022: memberThe variable does not need to be guarded by cs_main, so move it out of the cs_main scope. It is not used for validation-specific state, but only for headers-processing internal state and logging.
-
fanquake added the label Refactoring on Jul 6, 2022
-
in src/net_processing.cpp:2405 in fa34e723d1 outdated
2221@@ -2221,28 +2222,26 @@ void PeerManagerImpl::SendBlockTransactions(CNode& pfrom, Peer& peer, const CBlo 2222 * 2223 * We'll send a getheaders message in response to try to connect the chain. 2224 * 2225- * The peer can send up to MAX_UNCONNECTING_HEADERS in a row that 2226+ * The peer can send up to MAX_UNCONNECTING_HEADERS_MSGS in a row that
sdaftuar commented at 6:13 pm on July 6, 2022:Care to address this comment while you’re touching this line?
maflcko commented at 6:57 pm on July 6, 2022:Thanks, done.in src/net_processing.cpp:254 in fa34e723d1 outdated
249@@ -250,6 +250,9 @@ struct Peer { 250 * to the peer. */ 251 std::chrono::microseconds m_next_send_feefilter{0}; 252 253+ //! Length of current-streak of unconnecting headers announcements 254+ int num_unconnecting_headers_msgs{0};
sdaftuar commented at 6:14 pm on July 6, 2022:Should this be namedm_num_unconnecting_headers_msgs
for consistency with the style guide?
maflcko commented at 6:57 pm on July 6, 2022:Peer
is astruct
, so it shouldn’t usem_
prefixes. To quote the style guide:Class member variables have a m_ prefix.
For rationale, see for example #19759
(So in theory #25557 could drop the
m_
prefix)Though, I don’t care about the style guide too much, so I am happy to change this to make reviewers happy and I am also not going to comment on #25557 to suggest a change.
sdaftuar commented at 7:34 pm on July 6, 2022:Thanks for pointing me to that (and now I’m kicking myself for all thosem_
’s!)maflcko force-pushed on Jul 6, 2022DrahtBot commented at 3:13 am on July 7, 2022: contributorThe following sections might be updated with supplementary metadata relevant to reviewers and maintainers.
Conflicts
Reviewers, this pull request conflicts with the following ones:
- #26140 (refactor: Move CNodeState members guarded by g_msgproc_mutex to Peer by dergoegge)
- #24571 (p2p: Prevent block index fingerprinting by sending additional getheaders messages by dergoegge)
If you consider this pull request important, please also help to review the conflicting pull requests. Ideally, start with the one that should be merged first.
DrahtBot added the label Needs rebase on Jul 19, 2022maflcko renamed this:
refactor: Move num_unconnecting_headers_msgs out of cs_main guard
refactor: Move m_num_unconnecting_headers_msgs out of cs_main guard
on Jul 19, 2022maflcko force-pushed on Jul 19, 2022DrahtBot removed the label Needs rebase on Jul 19, 2022DrahtBot added the label Needs rebase on Aug 30, 2022achow101 commented at 7:42 pm on October 12, 2022: memberAre you still working on this?refactor: Move m_num_unconnecting_headers_msgs out of cs_main guard fad5d825a7maflcko force-pushed on Oct 24, 2022maflcko force-pushed on Oct 24, 2022DrahtBot removed the label Needs rebase on Oct 24, 2022maflcko commented at 1:15 pm on October 24, 2022: memberRebased, but closing for now to pick it up latermaflcko closed this on Oct 24, 2022
maflcko deleted the branch on Oct 24, 2022bitcoin locked this on Oct 24, 2023
maflcko sdaftuar DrahtBot achow101Labels
Refactoring
This is a metadata mirror of the GitHub repository bitcoin/bitcoin. This site is not affiliated with GitHub. Content is generated from a GitHub metadata backup.
generated: 2024-11-17 18:12 UTC
More mirrored repositories can be found on mirror.b10c.me