diff --git a/src/main.cpp b/src/main.cpp index da7b13e4d..0a20e77d8 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -706,7 +706,7 @@ bool IsStandardTx(const CTransaction& tx, string& reason) return true; } -bool IsFinalTx(const CTransaction &tx, int nBlockHeight, int64_t nBlockTime) +bool IsFinalTx(const CTransaction &tx, int nBlockHeight, int64_t nBlockTime,int flags) { static uint32_t grandfathered[] = { @@ -715,7 +715,7 @@ bool IsFinalTx(const CTransaction &tx, int nBlockHeight, int64_t nBlockTime) int32_t i; if (tx.nLockTime == 0) return true; - if ( ASSETCHAINS_SYMBOL[0] == 0 && (int64_t)tx.nLockTime >= LOCKTIME_THRESHOLD && (int64_t)tx.nLockTime < nBlockTime-3600 ) + if ( ASSETCHAINS_SYMBOL[0] == 0 && flags == STANDARD_LOCKTIME_VERIFY_FLAGS && (int64_t)tx.nLockTime >= LOCKTIME_THRESHOLD && (int64_t)tx.nLockTime < nBlockTime-3600 ) { for (i=0; iGetMedianTimePast() : GetAdjustedTime(); - return IsFinalTx(tx, nBlockHeight, nBlockTime); + return IsFinalTx(tx, nBlockHeight, nBlockTime,flags); } /** @@ -3292,7 +3292,7 @@ bool ContextualCheckBlock(const CBlock& block, CValidationState& state, CBlockIn int64_t nLockTimeCutoff = (nLockTimeFlags & LOCKTIME_MEDIAN_TIME_PAST) ? pindexPrev->GetMedianTimePast() : block.GetBlockTime(); - if (!IsFinalTx(tx, nHeight, nLockTimeCutoff)) { + if (!IsFinalTx(tx, nHeight, nLockTimeCutoff,0)) { return state.DoS(10, error("%s: contains a non-final transaction", __func__), REJECT_INVALID, "bad-txns-nonfinal"); } } diff --git a/src/main.h b/src/main.h index 6f349c7d7..0a137188d 100644 --- a/src/main.h +++ b/src/main.h @@ -351,7 +351,7 @@ bool IsStandardTx(const CTransaction& tx, std::string& reason); * Check if transaction is final and can be included in a block with the * specified height and time. Consensus critical. */ -bool IsFinalTx(const CTransaction &tx, int nBlockHeight, int64_t nBlockTime); +bool IsFinalTx(const CTransaction &tx, int nBlockHeight, int64_t nBlockTime, int flags); /** * Check if transaction will be final in the next block to be created. diff --git a/src/miner.cpp b/src/miner.cpp index dfec5825a..f53c7086a 100644 --- a/src/miner.cpp +++ b/src/miner.cpp @@ -201,7 +201,7 @@ CBlockTemplate* CreateNewBlock(const CScript& scriptPubKeyIn) ? nMedianTimePast : pblock->GetBlockTime(); - if (tx.IsCoinBase() || !IsFinalTx(tx, nHeight, nLockTimeCutoff)) + if (tx.IsCoinBase() || !IsFinalTx(tx, nHeight, nLockTimeCutoff,STANDARD_LOCKTIME_VERIFY_FLAGS)) continue; COrphan* porphan = NULL;