diff options
Diffstat (limited to 'src/bench')
-rw-r--r-- | src/bench/block_assemble.cpp | 3 | ||||
-rw-r--r-- | src/bench/checkblock.cpp | 9 |
2 files changed, 8 insertions, 4 deletions
diff --git a/src/bench/block_assemble.cpp b/src/bench/block_assemble.cpp index 36fa175a76..2bd67654ab 100644 --- a/src/bench/block_assemble.cpp +++ b/src/bench/block_assemble.cpp @@ -41,7 +41,8 @@ static CTxIn MineBlock(const CScript& coinbase_scriptPubKey) auto block = PrepareBlock(coinbase_scriptPubKey); while (!CheckProofOfWork(block->GetHash(), block->nBits, Params().GetConsensus())) { - assert(++block->nNonce); + ++block->nNonce; + assert(block->nNonce); } bool processed{ProcessNewBlock(Params(), block, true, nullptr)}; diff --git a/src/bench/checkblock.cpp b/src/bench/checkblock.cpp index fac7e079a7..387ae1769c 100644 --- a/src/bench/checkblock.cpp +++ b/src/bench/checkblock.cpp @@ -28,7 +28,8 @@ static void DeserializeBlockTest(benchmark::State& state) while (state.KeepRunning()) { CBlock block; stream >> block; - assert(stream.Rewind(sizeof(block_bench::block413567))); + bool rewound = stream.Rewind(sizeof(block_bench::block413567)); + assert(rewound); } } @@ -45,10 +46,12 @@ static void DeserializeAndCheckBlockTest(benchmark::State& state) while (state.KeepRunning()) { CBlock block; // Note that CBlock caches its checked state, so we need to recreate it here stream >> block; - assert(stream.Rewind(sizeof(block_bench::block413567))); + bool rewound = stream.Rewind(sizeof(block_bench::block413567)); + assert(rewound); CValidationState validationState; - assert(CheckBlock(block, validationState, chainParams->GetConsensus())); + bool checked = CheckBlock(block, validationState, chainParams->GetConsensus()); + assert(checked); } } |