<p>No.  In the reference client, main.cpp runs this check during "AcceptBlock":</p>

<pre><code>    // Check that all transactions are finalized
    BOOST_FOREACH(const CTransaction&amp; tx, block.vtx)
        if (!IsFinalTx(tx, nHeight, block.GetBlockTime()))
            return state.DoS(10, error("AcceptBlock() : contains a non-final transaction"),
                             REJECT_INVALID, "bad-txns-nonfinal");
</code></pre>

<p>which rejects your block if it contain a non-final transaction.  A client that accepts a block containing a transaction with a locktime in the future and sequence number less than <code>std::numeric_limits&lt;unsigned int&gt;::max()</code> would be on the losing side of a fork.</p>

CC BY-SA 3.0
2014-04-20T21:38:51.860Z
2014-04-20T21:38:51.860Z
Joe Amenta
<p>I know that non-final transactions (locktime in future and sequence number &lt; MAX_UINT) are not "accepted by miners". However, I could not figure out the exact behavior.</p>

<p>If I mined my own block with a non-final transaction, would that block be considered valid, i.e., would clients add it to their copy of the chain and would other miners build on top of that block? 
(I suppose the answer is "no" because otherwise attacks on contracts could be possible.)</p>

CC BY-SA 3.0
2014-02-17T20:40:52.730Z
This may be possible, assuming that other miners will accept your block and not orphan it.  However, you still need to sign the inputs of the transaction with the appropriate keys, so I'm not sure why you think that would allow an attack on a contract.
rdb
<contracts><locktime>
Could I mine a non-final transaction?
real-or-random
# Could I mine a non-final transaction?

(Asked by: username_0 on 2013-12-18)

I know that non-final transactions (locktime in future and sequence number < MAX\_UINT) are not "accepted by miners". However, I could not figure out the exact behavior.

If I mined my own block with a non-final transaction, would that block be considered valid, i.e., would clients add it to their copy of the chain and would other miners build on top of that block?
(I suppose the answer is "no" because otherwise attacks on contracts could be possible.)

**Tags:** contracts, locktime

> **Comments:**
> **username_1**: This may be possible, assuming that other miners will accept your block and not orphan it.  However, you still need to sign the inputs of the transaction with the appropriate keys, so I'm not sure why you think that would allow an attack on a contract.  

---

## 1 answers

### Answer by username_2 on 2014-04-20. Score: 5 | Accepted answer

No. In the reference client, main.cpp runs this check during "AcceptBlock":

```
    // Check that all transactions are finalized
    BOOST_FOREACH(const CTransaction& tx, block.vtx)
        if (!IsFinalTx(tx, nHeight, block.GetBlockTime()))
            return state.DoS(10, error("AcceptBlock() : contains a non-final transaction"),
                             REJECT_INVALID, "bad-txns-nonfinal");

```

which rejects your block if it contain a non-final transaction. A client that accepts a block containing a transaction with a locktime in the future and sequence number less than `std::numeric_limits<unsigned int>::max()` would be on the losing side of a fork.


---

