decoderawtransaction(getrawtrasaction(txid)) error #14483

issue wuchiachih opened this issue on October 15, 2018
  1. wuchiachih commented at 8:12 AM on October 15, 2018: none

    <!-- This issue tracker is only for technical issues related to Bitcoin Core. General bitcoin questions and/or support requests are best directed to the Bitcoin StackExchange at https://bitcoin.stackexchange.com. For reporting security issues, please read instructions at https://bitcoincore.org/en/contact/. If the node is "stuck" during sync or giving "block checksum mismatch" errors, please ensure your hardware is stable by running memtest and observe CPU temperature with a load-test tool such as linpack before creating an issue! -->

    <!-- Describe the issue -->

    Got a different txid while decoding this TX: f46c537e6b5fd02372d5b6c56debd37e4da770168fee921c25859a91957b057f

    <!--- What behavior did you expect? -->

    I thought I should get a TX with txid = f46c537e6b5fd02372d5b6c56debd37e4da770168fee921c25859a91957b057f

    <!--- What was the actual behavior (provide screenshots if the issue is GUI-related)? -->

    But, I get a TX with txid = 074104196feb30c7f3ac030ecc06b90f597e6458eca0e30c2f5fb5b49cef012d like this:

    <img width="792" alt="screen shot 2018-10-15 at 4 11 49 pm" src="https://user-images.githubusercontent.com/6262559/46937949-107afc00-d095-11e8-979f-3014a110c250.png">

    <!--- How reliably can you reproduce the issue, what are the steps to do so? -->

    I can always repro this on my Bitcoin Core node.

    <!-- What version of Bitcoin Core are you using, where did you get it (website, self-compiled, etc)? -->

    I'm running Bitcoin Core Daemon version v0.16.3.0-g49e34e288

    <!-- What type of machine are you observing the error on (OS/CPU and disk type)? -->

    <!-- Any extra information that might be useful in the debugging process. -->

    <!--- This is normally the contents of a `debug.log` or `config.log` file. Raw text or a link to a pastebin type site are preferred. -->

  2. meshcollider commented at 11:56 AM on October 15, 2018: contributor

    Could you try decoderawtransaction(getrawtrasaction(txid), true) please? It looks like it is just decoding as a non-segwit transaction instead of a segwit one.

  3. meshcollider added the label RPC/REST/ZMQ on Oct 15, 2018
  4. wuchiachih commented at 12:19 PM on October 15, 2018: none

    It works. So, we need to always put a "true" while calling decoderawtransaction() ?

  5. meshcollider commented at 12:24 PM on October 15, 2018: contributor

    @wuchiachih the decoding of a raw transaction is currently done based on some heuristics, c.f. #10481, and doesn't always correctly identify whether it is a segwit transaction or not. So the flag can be used to force it to be decoded as segwit or not if needed. If I were you, I would include the flag only if your sanity check fails - that the TXID is different.

  6. wuchiachih commented at 12:27 PM on October 15, 2018: none

    @wuchiachih the decoding of a raw transaction is currently done based on some heuristics, c.f. #10481, and doesn't always correctly identify whether it is a segwit transaction or not. So the flag can be used to force it to be decoded as segwit or not if needed. If I were you, I would include the flag only if your sanity check fails - that the TXID is different.

    Cool. Sounds like a solution!

  7. meshcollider closed this on Oct 15, 2018

  8. sipa commented at 12:32 PM on October 15, 2018: member

    You can always pass true if you know the transaction is complete (i.e. fully signed). The alternative is for dealing with transactions that may be missing inputs.

  9. DrahtBot locked this on Sep 8, 2021

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-13 15:15 UTC

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