From: Sunny King Date: Wed, 25 Apr 2012 03:30:34 +0000 (+0100) Subject: PPCoin: Only call CheckProofOfWork() for proof-of-work blocks X-Git-Tag: v0.4.0-unstable~184 X-Git-Url: https://git.novaco.in/?p=novacoin.git;a=commitdiff_plain;h=5ac231e123966edd5813d140dbe6e598eaed5108 PPCoin: Only call CheckProofOfWork() for proof-of-work blocks Fix ERROR: CheckProofOfWork() : hash doesn't match nBits ERROR: LoadBlockIndex() : CheckIndex failed at *** --- diff --git a/src/main.h b/src/main.h index 3ad6a04..6244695 100644 --- a/src/main.h +++ b/src/main.h @@ -1004,7 +1004,7 @@ public: filein >> *this; // Check the header - if (!CheckProofOfWork(GetHash(), nBits)) + if (IsProofOfWork() && !CheckProofOfWork(GetHash(), nBits)) return error("CBlock::ReadFromDisk() : errors in block header"); return true; @@ -1199,7 +1199,7 @@ public: bool CheckIndex() const { - return CheckProofOfWork(GetBlockHash(), nBits); + return IsProofOfWork() ? CheckProofOfWork(GetBlockHash(), nBits) : true; } bool EraseBlockFromDisk()