aboutsummaryrefslogtreecommitdiff
path: root/src/validation.cpp
diff options
context:
space:
mode:
authorNicolasDorier <nicolas.dorier@gmail.com>2016-09-09 11:51:08 +0900
committerNicolasDorier <nicolas.dorier@gmail.com>2017-02-19 14:02:45 +0900
commit4d51e9be165d860fac0eb6aff9931092605ccd1f (patch)
tree6d1a718600e1246828bd73a0400ca770aaffbcab /src/validation.cpp
parent972714c95687eda3afc209d62e0ed32fd50eef31 (diff)
Assert ConnectBlock block and pIndex are the same block
Diffstat (limited to 'src/validation.cpp')
-rw-r--r--src/validation.cpp5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/validation.cpp b/src/validation.cpp
index a83737377a..3ce7ffc7b2 100644
--- a/src/validation.cpp
+++ b/src/validation.cpp
@@ -1739,7 +1739,10 @@ bool ConnectBlock(const CBlock& block, CValidationState& state, CBlockIndex* pin
CCoinsViewCache& view, const CChainParams& chainparams, bool fJustCheck)
{
AssertLockHeld(cs_main);
-
+ assert(pindex);
+ // pindex->phashBlock can be null if called by CreateNewBlock/TestBlockValidity
+ assert((pindex->phashBlock == NULL) ||
+ (*pindex->phashBlock == block.GetHash()));
int64_t nTimeStart = GetTimeMicros();
// Check it again in case a previous version let a bad block in