aboutsummaryrefslogtreecommitdiff
path: root/src/net_processing.cpp
diff options
context:
space:
mode:
authorWladimir J. van der Laan <[email protected]>2016-12-14 09:33:14 +0100
committerWladimir J. van der Laan <[email protected]>2016-12-14 09:33:31 +0100
commit82ccac739e2a11086eda9827e52505a58c280e9a (patch)
tree8d5c6661ab4f74df189fb2966900d6577e07752d /src/net_processing.cpp
parentMerge #9326: Update for OpenSSL 1.1 API. (diff)
parentDo not run functions with necessary side-effects in assert() (diff)
downloaddiscoin-82ccac739e2a11086eda9827e52505a58c280e9a.tar.xz
discoin-82ccac739e2a11086eda9827e52505a58c280e9a.zip
Merge #9344: Do not run functions with necessary side-effects in assert()
da9cdd2 Do not run functions with necessary side-effects in assert() (Gregory Maxwell)
Diffstat (limited to 'src/net_processing.cpp')
-rw-r--r--src/net_processing.cpp6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/net_processing.cpp b/src/net_processing.cpp
index 0137108cf..cc07ef30b 100644
--- a/src/net_processing.cpp
+++ b/src/net_processing.cpp
@@ -1518,7 +1518,8 @@ bool static ProcessMessage(CNode* pfrom, string strCommand, CDataStream& vRecv,
}
CBlock block;
- assert(ReadBlockFromDisk(block, it->second, chainparams.GetConsensus()));
+ bool ret = ReadBlockFromDisk(block, it->second, chainparams.GetConsensus());
+ assert(ret);
BlockTransactions resp(req);
for (size_t i = 0; i < req.indexes.size(); i++) {
@@ -2730,7 +2731,8 @@ bool SendMessages(CNode* pto, CConnman& connman)
vHeaders.front().GetHash().ToString(), pto->id);
//TODO: Shouldn't need to reload block from disk, but requires refactor
CBlock block;
- assert(ReadBlockFromDisk(block, pBestIndex, consensusParams));
+ bool ret = ReadBlockFromDisk(block, pBestIndex, consensusParams);
+ assert(ret);
CBlockHeaderAndShortTxIDs cmpctblock(block, state.fWantsCmpctWitness);
int nSendFlags = state.fWantsCmpctWitness ? 0 : SERIALIZE_TRANSACTION_NO_WITNESS;
connman.PushMessage(pto, msgMaker.Make(nSendFlags, NetMsgType::CMPCTBLOCK, cmpctblock));