From 623b80c061f0b283c7900d748957b2c98c5f26aa Mon Sep 17 00:00:00 2001 From: Miguel Freitas Date: Sat, 20 Jul 2013 16:56:02 -0300 Subject: [PATCH] fix missing nHeight field --- src/chainparams.cpp | 1 + src/main.cpp | 2 +- src/main.h | 2 ++ 3 files changed, 4 insertions(+), 1 deletion(-) diff --git a/src/chainparams.cpp b/src/chainparams.cpp index 8175a0e8..04b848e7 100644 --- a/src/chainparams.cpp +++ b/src/chainparams.cpp @@ -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; diff --git a/src/main.cpp b/src/main.cpp index 28778cae..b478396e 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -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"); diff --git a/src/main.h b/src/main.h index 393ef98d..b6b9fd1b 100644 --- a/src/main.h +++ b/src/main.h @@ -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;