fix missing nHeight field

This commit is contained in:
Miguel Freitas 2013-07-20 16:56:02 -03:00
parent 7fd4a9f585
commit 623b80c061
3 changed files with 4 additions and 1 deletions

View File

@ -52,6 +52,7 @@ public:
genesis.hashPrevBlock = 0;
genesis.hashMerkleRoot = genesis.BuildMerkleTree();
genesis.nVersion = 1;
genesis.nHeight = 0;
genesis.nTime = 1373331180;
//genesis.nBits = 0x1d00ffff;
genesis.nBits = 0x1d7fffff;

View File

@ -878,7 +878,7 @@ bool CheckProofOfWork(uint256 hash, unsigned int nBits)
bnTarget.SetCompact(nBits);
//printf("CheckProofOfWork %08x %s %s\n", nBits, bnTarget.GetHex().c_str(), Params().ProofOfWorkLimit().GetHex().c_str());
//printf("hash-bits %s\n", (hash-bnTarget.getuint256()).GetHex().c_str() );
//printf("CheckProofOfWork hash:%s\n", hash.GetHex().c_str() );
// Check range
if (bnTarget <= 0 || bnTarget > Params().ProofOfWorkLimit())
return error("CheckProofOfWork() : nBits below minimum work");

View File

@ -712,6 +712,7 @@ public:
{
CBlockHeader block;
block.nVersion = nVersion;
block.nHeight = nHeight;
if (pprev)
block.hashPrevBlock = pprev->GetBlockHash();
block.hashMerkleRoot = hashMerkleRoot;
@ -860,6 +861,7 @@ public:
{
CBlockHeader block;
block.nVersion = nVersion;
block.nHeight = nHeight;
block.hashPrevBlock = hashPrev;
block.hashMerkleRoot = hashMerkleRoot;
block.nTime = nTime;