Skip to content

Commit

Permalink
Fix for Resync Problems
Browse files Browse the repository at this point in the history
When reading blocks from disk we need to perform a full POW-Check, not just the lite-version of it.
  • Loading branch information
zettel-kasten committed Jun 7, 2018
1 parent 17a2678 commit 04f25b8
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions src/main.h
Original file line number Diff line number Diff line change
Expand Up @@ -1715,8 +1715,14 @@ class CBlock : public CBlockHeader

// Check the header. Because this block is stored on disc it was already checked by us;
// therefore, it is considered unnecessary to perform expensive full pow-check here.
if (!CheckProofOfWorkLite())
return error("CBlock::ReadFromDisk() : errors in block header");
//if (!CheckProofOfWorkLite()){
// return error("CBlock::ReadFromDisk() : errors in block header");
//}

//Nope, very wrong! We need to do a full check of each header, no shortcuts here, honey.
if (!CheckProofOfWork()){
return error("CBlock::ReadFromDisk() : errors in block header --- FULL CheckProofOfWork");
}

return true;
}
Expand Down

0 comments on commit 04f25b8

Please sign in to comment.