Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Developer doc does not match Bitcoin Core for locktime standard rule #3727

Open
daira opened this issue Aug 10, 2021 · 2 comments
Open

Developer doc does not match Bitcoin Core for locktime standard rule #3727

daira opened this issue Aug 10, 2021 · 2 comments

Comments

@daira
Copy link
Contributor

daira commented Aug 10, 2021

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.

@murchandamus
Copy link
Contributor

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: #3237. Did the code in this repo regress in some way since then?

@murchandamus
Copy link
Contributor

Opened a PR to fix here: bitcoin-dot-org/developer.bitcoin.org#244

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants