refactor: Remove useless CBlock::GetBlockHeader

There is no need for a function to convert a CBlock to a CBlockHeader, as it's a child
class of it.
This commit is contained in:
Pieter Wuille
2022-08-31 10:47:16 -04:00
committed by Daniela Brozzoni
parent 4568652222
commit ca0243e3a6
7 changed files with 8 additions and 21 deletions

View File

@@ -4666,7 +4666,7 @@ void PeerManagerImpl::ProcessMessage(CNode& pfrom, const std::string& msg_type,
mapBlockSource.emplace(hash, std::make_pair(pfrom.GetId(), true));
// Check claimed work on this block against our anti-dos thresholds.
if (prev_block && prev_block->nChainWork + GetBlockProof(pblock->GetBlockHeader()) >= GetAntiDoSWorkThreshold()) {
if (prev_block && prev_block->nChainWork + GetBlockProof(*pblock) >= GetAntiDoSWorkThreshold()) {
min_pow_checked = true;
}
}