Skip to content

Commit

Permalink
Don't check for conflicting ChainLocks when phashBlock is not set
Browse files Browse the repository at this point in the history
Also don't set indexDummy.phashBlock in TestBlockValidity anymore.
  • Loading branch information
codablock committed Jan 28, 2019
1 parent 08d915d commit 5033d5e
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions src/validation.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1899,7 +1899,7 @@ static bool ConnectBlock(const CBlock& block, CValidationState& state, CBlockInd
if (!CheckBlock(block, state, chainparams.GetConsensus(), !fJustCheck, !fJustCheck))
return error("%s: Consensus::CheckBlock: %s", __func__, FormatStateMessage(state));

if (pindex->pprev && llmq::chainLocksHandler->HasConflictingChainLock(pindex->nHeight, pindex->GetBlockHash())) {
if (pindex->pprev && pindex->phashBlock && llmq::chainLocksHandler->HasConflictingChainLock(pindex->nHeight, pindex->GetBlockHash())) {
return state.DoS(10, error("%s: conflicting with chainlock", __func__), REJECT_INVALID, "bad-chainlock");
}

Expand Down Expand Up @@ -3616,7 +3616,6 @@ bool TestBlockValidity(CValidationState& state, const CChainParams& chainparams,
CBlockIndex indexDummy(block);
indexDummy.pprev = pindexPrev;
indexDummy.nHeight = pindexPrev->nHeight + 1;
indexDummy.phashBlock = &hash;

// begin tx and let it rollback
auto dbTx = evoDb->BeginTransaction();
Expand Down

0 comments on commit 5033d5e

Please sign in to comment.