Enable -ac_algo=verushash11

This commit is contained in:
blackjok3r
2019-01-22 00:12:05 +08:00
parent 45dfd3a590
commit 2c3247e8f1
10 changed files with 63 additions and 32 deletions

View File

@@ -46,8 +46,11 @@ uint256 CBlockHeader::GetVerusHash() const
uint256 CBlockHeader::GetVerusV2Hash() const
{
// no check for genesis block and use the optimized hash
return SerializeVerusHashV2(*this);
if (hashPrevBlock.IsNull())
// always use SHA256D for genesis block
return SerializeHash(*this);
else
return SerializeVerusHashV2(*this);
}
void CBlockHeader::SetSHA256DHash()
@@ -60,6 +63,11 @@ void CBlockHeader::SetVerusHash()
CBlockHeader::hashFunction = &CBlockHeader::GetVerusHash;
}
void CBlockHeader::SetVerusHashV2()
{
CBlockHeader::hashFunction = &CBlockHeader::GetVerusV2Hash;
}
// returns false if unable to fast calculate the VerusPOSHash from the header.
// if it returns false, value is set to 0, but it can still be calculated from the full block
// in that case. the only difference between this and the POS hash for the contest is that it is not divided by the value out