Bitcoin.org icon indicating copy to clipboard operation
Bitcoin.org copied to clipboard

Developer doc does not match Bitcoin Core for locktime standard rule

Open daira opened this issue 4 years ago • 2 comments

https://github.com/bitcoin/bitcoin/blob/9faa4b68db80a4a5c1f5a4e0484d804d7b5e1493/src/consensus/tx_verify.cpp#L21 :

    if (tx.nLockTime == 0)
        return true;
    if ((int64_t)tx.nLockTime < ((int64_t)tx.nLockTime < LOCKTIME_THRESHOLD ? (int64_t)nBlockHeight : nBlockTime))
        return true;

https://developer.bitcoin.org/devguide/transactions.html#non-standard-transactions :

As of Bitcoin Core 0.9.3, standard transactions must also meet the following conditions:

  • The transaction must be finalized: either its locktime must be in the past (or less than or equal to the current block height), or all of its sequence numbers must be 0xffffffff.

These do not match; "less than or equal to" should be "less than". Also it could be clearer that whether the restriction is time-based or height-based depends on whether the field is less than LOCKTIME_THRESHOLD = 500000000.

daira avatar Aug 10 '21 14:08 daira

Yeah, I was just looking into why this was wrong again. As far as I can tell this was already fixed once in 2020 here: https://github.com/bitcoin-dot-org/Bitcoin.org/pull/3237. Did the code in this repo regress in some way since then?

murchandamus avatar Dec 13 '23 15:12 murchandamus

Opened a PR to fix here: https://github.com/bitcoin-dot-org/developer.bitcoin.org/pull/244

murchandamus avatar Dec 13 '23 16:12 murchandamus