@@ -2690,8 +2690,8 @@ bool PeerManagerImpl::IsContinuationOfLowWorkHeadersSync(Peer& peer, CNode& pfro
2690
2690
2691
2691
bool PeerManagerImpl::TryLowWorkHeadersSync (Peer& peer, CNode& pfrom, const CBlockIndex* chain_start_header, std::vector<CBlockHeader>& headers)
2692
2692
{
2693
- // Calculate the total work on this chain.
2694
- arith_uint256 total_work = chain_start_header->nChainWork + CalculateHeadersWork (headers);
2693
+ // Calculate the claimed total work on this chain.
2694
+ arith_uint256 total_work = chain_start_header->nChainWork + CalculateClaimedHeadersWork (headers);
2695
2695
2696
2696
// Our dynamic anti-DoS threshold (minimum work required on a headers chain
2697
2697
// before we'll store it)
@@ -4424,7 +4424,7 @@ void PeerManagerImpl::ProcessMessage(CNode& pfrom, const std::string& msg_type,
4424
4424
MaybeSendGetHeaders (pfrom, GetLocator (m_chainman.m_best_header ), *peer);
4425
4425
}
4426
4426
return ;
4427
- } else if (prev_block->nChainWork + CalculateHeadersWork ({cmpctblock.header }) < GetAntiDoSWorkThreshold ()) {
4427
+ } else if (prev_block->nChainWork + CalculateClaimedHeadersWork ({cmpctblock.header }) < GetAntiDoSWorkThreshold ()) {
4428
4428
// If we get a low-work header in a compact block, we can ignore it.
4429
4429
LogPrint (BCLog::NET, " Ignoring low-work compact block from peer %d\n " , pfrom.GetId ());
4430
4430
return ;
@@ -4744,8 +4744,8 @@ void PeerManagerImpl::ProcessMessage(CNode& pfrom, const std::string& msg_type,
4744
4744
// cs_main in ProcessNewBlock is fine.
4745
4745
mapBlockSource.emplace (hash, std::make_pair (pfrom.GetId (), true ));
4746
4746
4747
- // Check work on this block against our anti-dos thresholds.
4748
- if (prev_block && prev_block->nChainWork + CalculateHeadersWork ({pblock->GetBlockHeader ()}) >= GetAntiDoSWorkThreshold ()) {
4747
+ // Check claimed work on this block against our anti-dos thresholds.
4748
+ if (prev_block && prev_block->nChainWork + CalculateClaimedHeadersWork ({pblock->GetBlockHeader ()}) >= GetAntiDoSWorkThreshold ()) {
4749
4749
min_pow_checked = true ;
4750
4750
}
4751
4751
}
0 commit comments