Tx accepted & executed even though locktime is well in the future. #14891

issue educob opened this issue on December 6, 2018
  1. educob commented at 10:51 PM on December 6, 2018: none

    Hi.

    I am running regtest in my computer. I compose a tx with locktime in 2020.

    02000000011b495ade2e4f3cc7748363117ce6ec2ebad584d3ab484541bb6c87a5f6a6ff0f010000006c4730440220783dbd2f31a487f223763225f281e19aecb31319e71d7905f4afd19fb6f1dedf02202cfde1f4073e89c700babebb4478eade9eb6191b55cc33ef9aa383bbdf81691d012321030f988291c015251223ce86ad8269d503e1d48874d3d52cadd04c36d21e21372dacffffffff02404b4c000000000017a91493a5c66603726fa80eda1e1f88e1a520bb5c206b877004530b0000000017a91459c42b82c33c876aa92b6a079177bcb01d98197287e2fec95f You can see in https://coinb.in/?verify#verify that locktime is 1607073506 which is in 2020.

    I am running Bitcoin Core Daemon version v0.17.0.0-ge1ed37edaedc85b8c3468bd9a726046344036243

    Why is the tx executed? Thanks.

  2. educob commented at 9:05 AM on December 7, 2018: none

    Hi.

    I made it work by calling

    txb.addInput(utxo_tx, utxo_n, bitcoin.Transaction.DEFAULT_SEQUENCE-1) Without specifying the sequence, the input sequence ends up being 0xffffffff and that means that locktime is ignored.

    Unless I am doing something wrong, bitcoinjs-lib test examples are wrong cause they don't specify the 3er argument when calling addInput.

  3. MarcoFalke commented at 4:42 PM on December 7, 2018: member

    Is this a bug report about bitcoinjs-lib?

  4. educob commented at 7:55 PM on December 7, 2018: none

    I thought I was having an issue with the bitcoin node to finally discover that it was an issue with bitcoinjs-lib. I wouldn't call it a bug but certaintlly at least the library could give a warning, when setting tx locktime, that the locktime won't have any effect unless one input had a sequence less than the maximum.

    Thanks.

  5. MarcoFalke closed this on Dec 7, 2018

  6. DrahtBot locked this on Sep 8, 2021
Contributors

github-metadata-mirror

This is a metadata mirror of the GitHub repository bitcoin/bitcoin. This site is not affiliated with GitHub. Content is generated from a GitHub metadata backup.
generated: 2026-04-17 03:14 UTC

This site is hosted by @0xB10C
More mirrored repositories can be found on mirror.b10c.me