And clean up some comments. Confusion about what this is doing seems to be a running theme:
Rename CalculateHeadersWork to CalculateClaimedHeadersWork #29569
pull instagibbs wants to merge 1 commits into bitcoin:master from instagibbs:2024-03-claimed_work changing 4 files +9 −9-
instagibbs commented at 3:07 PM on March 5, 2024: member
-
Rename CalculateHeadersWork to CalculateClaimedHeadersWork eb7cc9fd21
-
DrahtBot commented at 3:07 PM on March 5, 2024: contributor
<!--e57a25ab6845829454e8d69fc972939a-->
The following sections might be updated with supplementary metadata relevant to reviewers and maintainers.
<!--006a51241073e994b41acfe9ec718e94-->
Code Coverage
For detailed information about the code coverage, see the test coverage report.
<!--021abf342d371248e50ceaed478a90ca-->
Reviews
See the guideline for information on the review process.
Type Reviewers ACK pablomartin4btc, 0xB10C, dergoegge, BrandonOdiwuor, achow101 If your review is incorrectly listed, please react with 👎 to this comment and the bot will ignore it on the next update.
-
pablomartin4btc commented at 5:34 PM on March 5, 2024: member
ACK eb7cc9fd2140df77acc6eb42004cf45b260bc629
-
in src/net_processing.cpp:4749 in eb7cc9fd21
4743 | @@ -4744,8 +4744,8 @@ void PeerManagerImpl::ProcessMessage(CNode& pfrom, const std::string& msg_type, 4744 | // cs_main in ProcessNewBlock is fine. 4745 | mapBlockSource.emplace(hash, std::make_pair(pfrom.GetId(), true)); 4746 | 4747 | - // Check work on this block against our anti-dos thresholds. 4748 | - if (prev_block && prev_block->nChainWork + CalculateHeadersWork({pblock->GetBlockHeader()}) >= GetAntiDoSWorkThreshold()) { 4749 | + // Check claimed work on this block against our anti-dos thresholds. 4750 | + if (prev_block && prev_block->nChainWork + CalculateClaimedHeadersWork({pblock->GetBlockHeader()}) >= GetAntiDoSWorkThreshold()) { 4751 | min_pow_checked = true;
0xB10C commented at 8:44 AM on March 6, 2024:nit: I also found
min_pow_checkedconfusing. At least I read "PoW checked" at first.
instagibbs commented at 7:17 PM on March 6, 2024:agreed it's also confusing, but it's also called that down the call stack for a bit, so I kept scope to here
0xB10C approved0xB10C commented at 8:48 AM on March 6, 2024: contributorACK eb7cc9fd2140df77acc6eb42004cf45b260bc629
I misinterpreted
CalculateHeadersWork-CalculateClaimedHeadersWorkis a bit clearer.dergoegge approveddergoegge commented at 9:24 AM on March 6, 2024: memberACK eb7cc9fd2140df77acc6eb42004cf45b260bc629
BrandonOdiwuor approvedBrandonOdiwuor commented at 4:08 PM on March 8, 2024: contributorACK eb7cc9fd2140df77acc6eb42004cf45b260bc629
achow101 commented at 2:31 AM on March 9, 2024: memberACK eb7cc9fd2140df77acc6eb42004cf45b260bc629
achow101 merged this on Mar 9, 2024achow101 closed this on Mar 9, 2024bitcoin locked this on Mar 9, 2025
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: 2026-04-27 03:13 UTC
More mirrored repositories can be found on mirror.b10c.me