From 04f25b8e4a34bd9a40be2f8c6e081cb14266daf3 Mon Sep 17 00:00:00 2001 From: Zettelkasten <37848177+zettel-kasten@users.noreply.github.com> Date: Thu, 7 Jun 2018 09:21:57 +0200 Subject: [PATCH] Fix for Resync Problems When reading blocks from disk we need to perform a full POW-Check, not just the lite-version of it. --- src/main.h | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/src/main.h b/src/main.h index 714a829..545ec59 100644 --- a/src/main.h +++ b/src/main.h @@ -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; }