Skip to content

Commit 1c48b4b

Browse files
authored
Merge pull request duality-solutions#197 from duality-solutions/v2.3-WIP-Fix-Reindex
[Fluid] Fix segfault when running reindex
2 parents fc5cccb + 757749d commit 1c48b4b

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

src/validation.cpp

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3383,9 +3383,11 @@ bool ContextualCheckBlock(const CBlock& block, CValidationState& state, const CB
33833383

33843384
// Check that all transactions are finalized
33853385
for (const CTransaction& tx : block.vtx) {
3386-
if (!fluid.CheckTransactionToBlock(tx, pindexPrev->GetBlockHeader()))
3387-
return state.DoS(10, error("%s: contains an invalid fluid transaction", __func__), REJECT_INVALID, "invalid-fluid-txns");
3388-
3386+
if (pindexPrev != nullptr) {
3387+
if (!fluid.CheckTransactionToBlock(tx, pindexPrev->GetBlockHeader()))
3388+
return state.DoS(10, error("%s: contains an invalid fluid transaction", __func__), REJECT_INVALID, "invalid-fluid-txns");
3389+
}
3390+
33893391
if (!IsFinalTx(tx, nHeight, nLockTimeCutoff)) {
33903392
return state.DoS(10, error("%s: contains a non-final transaction", __func__), REJECT_INVALID, "bad-txns-nonfinal");
33913393
}

0 commit comments

Comments
 (0)