Radical hash rate optimization

This commit is contained in:
Michael Toutonghi
2018-06-26 07:39:50 -07:00
parent 1a0fc30896
commit 4dcb64c081
15 changed files with 271 additions and 151 deletions

View File

@@ -27,19 +27,10 @@ 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
uint256 CBlockHeader::GetVerusV2Hash() const
{
// no check for genesis block and use the optimized hash
return SerializeVerusMiningHash(*this);
return SerializeVerusHashV2(*this);
}
void CBlockHeader::SetSHA256DHash()
@@ -52,11 +43,6 @@ 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