<p>A transaction becomes valid when the chaintip reaches the height specified in the locktime, and may be included in any block with a height <strong>greater</strong> than <code>nLockTime</code>.</p>

<blockquote>
<pre><code>    if ((int64_t)tx.nLockTime &lt; ((int64_t)tx.nLockTime &lt; LOCKTIME_THRESHOLD ? (int64_t)nBlockHeight : nBlockTime))
    return true; 
</code></pre>
  
  <p>via <a href="https://github.com/bitcoin/bitcoin/blob/v0.19.0.1/src/consensus/tx_verify.cpp#L21L22" rel="nofollow noreferrer">https://github.com/bitcoin/bitcoin/blob/v0.19.0.1/src/consensus/tx_verify.cpp#L21L22</a></p>
</blockquote>

<p>H/T Pieter Wuille for code section and explanation.</p>

CC BY-SA 4.0
2019-12-19T02:33:25.637Z
2019-12-19T02:33:25.637Z
Murch
<p>Transactions with outputs whose sequence is smaller than <code>UINT_MAX</code> are interpreted as locked until the timestamp or block height specified in <code>nLockTime</code> is reached.</p>

<p>Specifically regarding the block height, I read imprecise or disagreeing information on whether a transaction may be included in a block of <code>height &gt; nLockTime</code> or <code>height ≥ nLockTime</code>. Which of the two is the case?</p>

<transaction-verification><locktime><block-validity><height>
At what block height may locktimed transactions get included?
Murch
# At what block height may locktimed transactions get included?

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

Transactions with outputs whose sequence is smaller than `UINT_MAX` are interpreted as locked until the timestamp or block height specified in `nLockTime` is reached.

Specifically regarding the block height, I read imprecise or disagreeing information on whether a transaction may be included in a block of `height > nLockTime` or `height ≥ nLockTime`. Which of the two is the case?

**Tags:** transaction-verification, locktime, block-validity, height


---

## 1 answers

### Answer by username_0 on 2019-12-19. Score: 3 | Accepted answer

A transaction becomes valid when the chaintip reaches the height specified in the locktime, and may be included in any block with a height **greater** than `nLockTime`.

> ```
>     if ((int64_t)tx.nLockTime < ((int64_t)tx.nLockTime < LOCKTIME_THRESHOLD ? (int64_t)nBlockHeight : nBlockTime))
>     return true; 
>
> ```
>
> via <https://github.com/bitcoin/bitcoin/blob/v0.19.0.1/src/consensus/tx_verify.cpp#L21L22>

H/T Pieter Wuille for code section and explanation.


---

