Browse Source

exclude GetHashPow()

pull/5/head
orignal 8 years ago
parent
commit
5650734a7e
  1. 4
      src/main.cpp
  2. 9
      src/main.h

4
src/main.cpp

@ -2244,7 +2244,7 @@ bool CBlock::CheckBlock(CValidationState &state, bool fCheckPOW, bool fCheckMerk @@ -2244,7 +2244,7 @@ bool CBlock::CheckBlock(CValidationState &state, bool fCheckPOW, bool fCheckMerk
}
// Check proof of work matches claimed amount
if (fCheckPOW && !CheckProofOfWork(GetPoWHash(), nBits))
if (fCheckPOW && !CheckProofOfWork(GetHash(), nBits))
return state.DoS(50, error("CheckBlock() : proof of work failed"));
// Check timestamp
@ -4666,7 +4666,7 @@ void FormatHashBuffers(CBlock* pblock, char* pmidstate, char* pdata, char* phash @@ -4666,7 +4666,7 @@ void FormatHashBuffers(CBlock* pblock, char* pmidstate, char* pdata, char* phash
bool CheckWork(CBlock* pblock, CWallet& wallet, CReserveKey& reservekey)
{
uint256 hash = pblock->GetPoWHash();
uint256 hash = pblock->GetHash();
uint256 hashTarget = CBigNum().SetCompact(pblock->nBits).getuint256();
if (hash > hashTarget)

9
src/main.h

@ -1360,11 +1360,6 @@ public: @@ -1360,11 +1360,6 @@ public:
vMerkleTree.clear();
}
uint256 GetPoWHash() const
{
return GetHash ();
}
CBlockHeader GetBlockHeader() const
{
CBlockHeader block;
@ -1477,7 +1472,7 @@ public: @@ -1477,7 +1472,7 @@ public:
}
// Check the header
if (!CheckProofOfWork(GetPoWHash(), nBits))
if (!CheckProofOfWork(GetHash(), nBits))
return error("CBlock::ReadFromDisk() : errors in block header");
return true;
@ -1490,7 +1485,7 @@ public: @@ -1490,7 +1485,7 @@ public:
printf("CBlock(hash=%s, input=%s, PoW=%s, ver=%d, hashPrevBlock=%s, hashMerkleRoot=%s, nTime=%u, nBits=%08x, nNonce=%u, vtx=%"PRIszu")\n",
GetHash().ToString().c_str(),
HexStr(BEGIN(nVersion),BEGIN(nVersion)+80,false).c_str(),
GetPoWHash().ToString().c_str(),
GetHash().ToString().c_str(),
nVersion,
hashPrevBlock.ToString().c_str(),
hashMerkleRoot.ToString().c_str(),

Loading…
Cancel
Save