PoS improvements
This commit is contained in:
@@ -7,6 +7,7 @@
|
||||
#define BITCOIN_PRIMITIVES_BLOCK_H
|
||||
|
||||
#include "primitives/transaction.h"
|
||||
#include "primitives/nonce.h"
|
||||
#include "serialize.h"
|
||||
#include "uint256.h"
|
||||
#include "arith_uint256.h"
|
||||
@@ -33,7 +34,7 @@ public:
|
||||
uint256 hashReserved;
|
||||
uint32_t nTime;
|
||||
uint32_t nBits;
|
||||
uint256 nNonce;
|
||||
CPOSNonce nNonce;
|
||||
std::vector<unsigned char> nSolution;
|
||||
|
||||
CBlockHeader()
|
||||
@@ -84,6 +85,9 @@ public:
|
||||
uint256 GetVerusHash() const;
|
||||
static void SetVerusHash();
|
||||
|
||||
bool GetVerusPOSHash(uint256 &value, int32_t nHeight) const;
|
||||
uint256 GetVerusEntropyHash(int32_t nHeight) const;
|
||||
|
||||
uint256 GetVerusV2Hash() const;
|
||||
|
||||
int64_t GetBlockTime() const
|
||||
@@ -105,11 +109,7 @@ public:
|
||||
|
||||
bool IsVerusPOSBlock() const
|
||||
{
|
||||
arith_uint256 arNonce = UintToArith256(nNonce);
|
||||
arith_uint256 tmpNonce = ((arNonce << 128) >> 128);
|
||||
CVerusHashWriter hashWriter = CVerusHashWriter(SER_GETHASH, PROTOCOL_VERSION);
|
||||
hashWriter << ArithToUint256(tmpNonce);
|
||||
return (nNonce == ArithToUint256(UintToArith256(hashWriter.GetHash()) << 128 | tmpNonce));
|
||||
return nNonce.IsPOSNonce();
|
||||
}
|
||||
|
||||
void SetVerusPOSTarget(int32_t nBits)
|
||||
|
||||
Reference in New Issue
Block a user