@@ -205,20 +205,16 @@ CBlockTreeDB *pblocktree = NULL;
205
205
206
206
bool IsFinalTx (const CTransaction &tx, int nBlockHeight, int64_t nBlockTime)
207
207
{
208
- CBlockIndex* pblockindex = chainActive[nBlockHeight-1 ];
209
-
210
208
if (tx.nLockTime == 0 )
211
209
return true ;
210
+
212
211
if ((int64_t )tx.nLockTime < ((int64_t )tx.nLockTime < LOCKTIME_THRESHOLD ? (int64_t )nBlockHeight : nBlockTime))
213
212
return true ;
214
213
215
214
if (nBlockHeight >= fluid.FLUID_ACTIVATE_HEIGHT ) {
216
215
if (!fluid.ProvisionalCheckTransaction (tx))
217
216
return false ;
218
217
219
- if (!fluid.CheckTransactionToBlock (tx, pblockindex->GetBlockHeader ()))
220
- return false ;
221
-
222
218
BOOST_FOREACH (const CTxOut& txout, tx.vout ) {
223
219
if (IsTransactionFluid (txout.scriptPubKey )) {
224
220
std::string strErrorMessage;
@@ -3374,6 +3370,9 @@ bool ContextualCheckBlock(const CBlock& block, CValidationState& state, const CB
3374
3370
3375
3371
// Check that all transactions are finalized
3376
3372
for (const CTransaction& tx : block.vtx ) {
3373
+ if (!fluid.CheckTransactionToBlock (tx, pindexPrev->GetBlockHeader ()))
3374
+ return state.DoS (10 , error (" %s: contains an invalid fluid transaction" , __func__), REJECT_INVALID, " invalid-fluid-txns" );
3375
+
3377
3376
if (!IsFinalTx (tx, nHeight, nLockTimeCutoff)) {
3378
3377
return state.DoS (10 , error (" %s: contains a non-final transaction" , __func__), REJECT_INVALID, " bad-txns-nonfinal" );
3379
3378
}
@@ -3390,13 +3389,6 @@ bool ContextualCheckBlock(const CBlock& block, CValidationState& state, const CB
3390
3389
}
3391
3390
}
3392
3391
3393
- // Check that all transactions are finalized
3394
- for (const CTransaction& tx : block.vtx ) {
3395
- if (!IsFinalTx (tx, nHeight, nLockTimeCutoff)) {
3396
- return state.DoS (10 , error (" %s: contains a non-final transaction" , __func__), REJECT_INVALID, " bad-txns-nonfinal" );
3397
- }
3398
- }
3399
-
3400
3392
// If Fluid transaction present, has it been adhered to?
3401
3393
CDynamicAddress mintAddress; CAmount fluidIssuance;
3402
3394
0 commit comments