Portable VerusHash and CPU check

This commit is contained in:
Michael Toutonghi
2018-06-16 14:51:13 -07:00
parent 2c05c25598
commit 5296a85018
10 changed files with 537 additions and 5 deletions

View File

@@ -27,6 +27,15 @@ uint256 CBlockHeader::GetVerusHash() const
return SerializeVerusHash(*this);
}
uint256 CBlockHeader::GetVerusHashPortable() const
{
if (hashPrevBlock.IsNull())
// always use SHA256D for genesis block
return SerializeHash(*this);
else
return SerializeVerusHashPortable(*this);
}
uint256 CBlockHeader::GetVerusMiningHash() const
{
// no check for genesis block and use the optimized hash
@@ -43,6 +52,11 @@ void CBlockHeader::SetVerusHash()
CBlockHeader::hashFunction = &CBlockHeader::GetVerusHash;
}
void CBlockHeader::SetVerusHashPortable()
{
CBlockHeader::hashFunction = &CBlockHeader::GetVerusHashPortable;
}
uint256 CBlock::BuildMerkleTree(bool* fMutated) const
{
/* WARNING! If you're reading this because you're learning about crypto