aboutsummaryrefslogtreecommitdiff
path: root/src/bench/block_assemble.cpp
diff options
context:
space:
mode:
authorMarcoFalke <falke.marco@gmail.com>2018-08-13 10:02:09 -0400
committerMarcoFalke <falke.marco@gmail.com>2018-08-13 10:02:50 -0400
commitf87d0a9d75b366445f880041c56c725f8196364e (patch)
treec64d2f6923109e48cf06d42e1da10e2612560671 /src/bench/block_assemble.cpp
parentafa960002086419feeaf3e50a7003855d39c8111 (diff)
parent6ad0328f1c3e145d3224197eafd0f66b17cc1a1c (diff)
downloadbitcoin-f87d0a9d75b366445f880041c56c725f8196364e.tar.xz
Merge #13534: Don't assert(foo()) where foo() has side effects
6ad0328f1c Don't assert(foo()) where foo has side effects (practicalswift) Pull request description: Don't `assert(foo())` where `foo` has side effects. From `assert(3)`: > If the macro `NDEBUG` is defined at the moment `<assert.h>` was last included, the macro `assert()` generates no code, and hence does nothing at all. Bitcoin currently cannot be compiled without assertions, but we shouldn't rely on that. Tree-SHA512: 28cff0c6d1c2fb612ca58c9c94142ed01c5cfd0a2fecb8e59cdb6c270374b215d952ed3491d921d84dc1b439fa49da4f0e75e080f6adcbc6b0e08be14e54c170
Diffstat (limited to 'src/bench/block_assemble.cpp')
-rw-r--r--src/bench/block_assemble.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/bench/block_assemble.cpp b/src/bench/block_assemble.cpp
index 8041209615..bc99b8cdcd 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)};