Browse Source

fix missing nHeight field

miguelfreitas
Miguel Freitas 12 years ago
parent
commit
623b80c061
  1. 1
      src/chainparams.cpp
  2. 2
      src/main.cpp
  3. 2
      src/main.h

1
src/chainparams.cpp

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

2
src/main.cpp

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

2
src/main.h

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

Loading…
Cancel
Save