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

@@ -84,10 +84,7 @@ public:
uint256 GetVerusHash() const;
static void SetVerusHash();
uint256 GetVerusHashPortable() const;
static void SetVerusHashPortable();
uint256 GetVerusMiningHash() const;
uint256 GetVerusV2Hash() const;
int64_t GetBlockTime() const
{
@@ -110,14 +107,14 @@ public:
{
arith_uint256 arNonce = UintToArith256(nNonce);
arith_uint256 tmpNonce = ((arNonce << 128) >> 128);
CVerusHashPortableWriter hashWriter = CVerusHashPortableWriter(SER_GETHASH, PROTOCOL_VERSION);
CVerusHashWriter hashWriter = CVerusHashWriter(SER_GETHASH, PROTOCOL_VERSION);
hashWriter << ArithToUint256(tmpNonce);
return (nNonce == ArithToUint256(UintToArith256(hashWriter.GetHash()) << 128 | tmpNonce));
}
void SetVerusPOSTarget(int32_t nBits)
{
CVerusHashPortableWriter hashWriter = CVerusHashPortableWriter(SER_GETHASH, PROTOCOL_VERSION);
CVerusHashWriter hashWriter = CVerusHashWriter(SER_GETHASH, PROTOCOL_VERSION);
uint256 hash;
arith_uint256 tmpNonce;