From a25fd6be138ff2bff7e2ad6a1a789db523c0193f Mon Sep 17 00:00:00 2001 From: SergioDemianLerner Date: Thu, 4 Sep 2014 16:23:42 -0300 Subject: Switch testing framework from MAIN to new UNITTEST network UNITTEST inherites from MAIN but allows synamically changing its parameters using the ModifiableParams() interface --- src/main.cpp | 1 + 1 file changed, 1 insertion(+) (limited to 'src/main.cpp') diff --git a/src/main.cpp b/src/main.cpp index 9a4271eda2..4bd8fd6e36 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -2304,6 +2304,7 @@ bool AcceptBlockHeader(CBlockHeader& block, CValidationState& state, CBlockIndex nHeight = pindexPrev->nHeight+1; // Check proof of work + if (!Params().SkipProofOfWorkCheck()) if (block.nBits != GetNextWorkRequired(pindexPrev, &block)) return state.DoS(100, error("AcceptBlock() : incorrect proof of work"), REJECT_INVALID, "bad-diffbits"); -- cgit v1.2.3 From 5e2e7fcb99738d9254d4030d53e4f711b2fc5ee0 Mon Sep 17 00:00:00 2001 From: SergioDemianLerner Date: Tue, 9 Sep 2014 13:29:24 -0300 Subject: Suggested corrections on comments, variable names. Also new test case testing the PoW skip in UNITTEST. --- src/main.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/main.cpp') diff --git a/src/main.cpp b/src/main.cpp index 4bd8fd6e36..7e60fd4ff9 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -2304,8 +2304,8 @@ bool AcceptBlockHeader(CBlockHeader& block, CValidationState& state, CBlockIndex nHeight = pindexPrev->nHeight+1; // Check proof of work - if (!Params().SkipProofOfWorkCheck()) - if (block.nBits != GetNextWorkRequired(pindexPrev, &block)) + if ((!Params().SkipProofOfWorkCheck()) && + (block.nBits != GetNextWorkRequired(pindexPrev, &block))) return state.DoS(100, error("AcceptBlock() : incorrect proof of work"), REJECT_INVALID, "bad-diffbits"); -- cgit v1.2.3