mirror of
https://github.com/bitcoin/bitcoin.git
synced 2026-02-11 17:52:48 +01:00
refactor: Use std::span in HasValidProofOfWork
Co-Authored-By: Pieter Wuille <pieter@wuille.net>
This commit is contained in:
@@ -4130,10 +4130,10 @@ std::vector<unsigned char> ChainstateManager::GenerateCoinbaseCommitment(CBlock&
|
||||
return commitment;
|
||||
}
|
||||
|
||||
bool HasValidProofOfWork(const std::vector<CBlockHeader>& headers, const Consensus::Params& consensusParams)
|
||||
bool HasValidProofOfWork(std::span<const CBlockHeader> headers, const Consensus::Params& consensusParams)
|
||||
{
|
||||
return std::all_of(headers.cbegin(), headers.cend(),
|
||||
[&](const auto& header) { return CheckProofOfWork(header.GetHash(), header.nBits, consensusParams);});
|
||||
return std::ranges::all_of(headers,
|
||||
[&](const auto& header) { return CheckProofOfWork(header.GetHash(), header.nBits, consensusParams); });
|
||||
}
|
||||
|
||||
bool IsBlockMutated(const CBlock& block, bool check_witness_root)
|
||||
|
||||
Reference in New Issue
Block a user