Skip to content

getrawtransaction fails (0.18.0) #16142

Closed

Description

@nikitasius

getrawtransaction fails

Return decoded raw tx

  • bitcoin-qt -prune=8192 -server -rpcuser=rpc -rpcpassword=rpc -onlynet=ipv4 -rpcbind=127.0.0.1:18332 -testnet
    • BTC 0.18.0
    • getrawtransaction b423b2b22d6d74376de2887c07f7c84ae890a93d541fcc6dbf3686f2923b2753 1
      image
    • BTC 0.17.1
    • getrawtransaction b423b2b22d6d74376de2887c07f7c84ae890a93d541fcc6dbf3686f2923b2753 1
      image

Request getrawtransaction.

Official from site.

Linux pentagon 4.9.0-9-amd64 #1 SMP Debian 4.9.168-1+deb9u2 (2019-05-13) x86_64 GNU/Linux, u5200, 2x8Gb, SSD

QT

Activity

  1. changed the title [-]`getrawtransaction` fails[/-] [+]`getrawtransaction` fails (0.18.0)[/+] on Jun 3, 2019
  2. maflcko commented on Jun 4, 2019

    @maflcko
    Member

    Please see the error message for alternatives.

    For some reason it doesn't mention that you can also provide the block hash as parameter to getrawtransaction. Imo, it should.

  3. maflcko commented on Jun 4, 2019

    @maflcko
    Member

    In your case getrawtransaction b423b2b22d6d74376de2887c07f7c84ae890a93d541fcc6dbf3686f2923b2753 1 00000000000000409e394d133807fd4f6b0fd27ade24a6e717ee257e825167e1

  4. achow101 commented on Jun 5, 2019

    @achow101
    Member

    This is intended behavior. Transactions that have outputs in the UTXO set are no longer looked up in getrawtransaction. See #15159

  5. nikitasius commented on Jun 5, 2019

    @nikitasius
    Author

    @MarcoFalke

    In your case getrawtransaction b423b2b22d6d74376de2887c07f7c84ae890a93d541fcc6dbf3686f2923b2753 1 00000000000000409e394d133807fd4f6b0fd27ade24a6e717ee257e825167e1

    @achow101

    Look:
    image

    • i use SAME data from 0.17.1 on 0.18.1
    • i open CLEAN console JUST after start
    • i type getrawtransaction b423b2b22d6d74376de2887c07f7c84ae890a93d541fcc6dbf3686f2923b2753 1
    • And i get those 2 errors (!)
      • it write executing commant using wallet (probably not error, maybe just notification for me)
      • it can't find TX data in saved blockchain part

    There are NOT only getrawtransaction failed, there are really strange behavior for 0.18.0.

  6. maflcko commented on Jun 5, 2019

    @maflcko
    Member

    @nikitasius Again, this (breaking) change was intended for 0.18.0. Could you please type in

    getrawtransaction b423b2b22d6d74376de2887c07f7c84ae890a93d541fcc6dbf3686f2923b2753 1 00000000000000409e394d133807fd4f6b0fd27ade24a6e717ee257e825167e1
    

    Note that it uses three arguments. You can use help getrawtransaction to see their help text.

  7. nikitasius commented on Jun 5, 2019

    @nikitasius
    Author

    @MarcoFalke this way it work.

    image

    So: shortly now everyone obliged to call this call with adding blockhash information?

    There are no more way just give txid to client? Everyone must call listunspent to get unspent tx and then call idk what else need to look btc manual to get blockhash for tx i need. I'm correct?

  8. nikitasius commented on Jun 5, 2019

    @nikitasius
    Author

    yes,

    • listunspent if needed
    • gettransaction with tx id
    • getrawtransaction to get what i really need.

    @MarcoFalke on next 0.18.1 it will be 1 more call to do?

  9. sipa commented on Jun 5, 2019

    @sipa
    Member

    @nikitasius Note that you can turn on txindex, which will enable using getrawtransaction with just the txid. But you need to enable it, because it now requires an index to query for these things efficiently.

  10. sipa commented on Jun 5, 2019

    @sipa
    Member

    @nikitasius Also, if it's about wallet transactions, you can just only call gettransaction with the decode flag enabled; no need for getrawtransaction ever.

    All that was removed is the ability to use getrawtransaction for non-wallet transactions, without enabling txindex.

  11. nikitasius commented on Jun 5, 2019

    @nikitasius
    Author

    @nikitasius Also, if it's about wallet transactions, you can just only call gettransaction with the decode flag enabled; no need for getrawtransaction ever.

    All that was removed is the ability to use getrawtransaction for non-wallet transactions, without enabling txindex.

    Before i was requesting wallet transactions and non-wallet (parent tx), to get info about parent tx.

    About txindex:

    • i have it enabled on my prod
    • on dev and laptop i use with prune and it was handy to get info about recent transactions who sent me coins on testnet.

    Then, for example, i pick an old tx from blockchain:

    • curl -u rpc:rpc -X POST -H "Content-Type: application/json" --data '{"jsonrpc":"2.0","id":"1","method":"getrawtransaction","params":["f38888cd5f99b54bbd32c9f4c0444345277f8f8d5803dc93c5af319378997953",1,"00000000001012f9088a1f33694881732c6f168bc13c9894eaeb3dcbfc3d6893"]}' http://127.0.0.1:18332
      • on laptop without txindex {"result":null,"error":{"code":-1,"message":"Block not available"},"id":"1"} - no result
      • on dev with txindex {"result":{"in_active_chain":true,"txid":"f38888cd5f99b54bbd32c9f4c0444345277f8f8d5803dc9.... - correct result

    So, with this actual changes we:

    • lost abillity to get raw information about ALL latest transactions (what inside blockchain data we stored) on prunes instances

    @sipa you allow in 0.18.0 to get raw information when you specify blockhash, but it's still limited by the blockchain you store (8Gb for example).

    This is totally unuseful update. It can be useful in one situation:

    • you allow to get information about ANY transaction on blockhain no matter how much you store.

    In such case YES, this is useful to get blockhash and use it.

    But actually:

    • we lost functionality we had without any good reasons for.

    And this is very bad.

  12. NicolasDorier commented on Jun 5, 2019

    @NicolasDorier
    Contributor

    It would be actually useful to have a new RPC call to query the blockId of a transaction by using the UTXO set, so at least people have an alternative which does not rely on the wallet.

  13. 13 remaining items

  14. nikitasius commented on Jun 5, 2019

    @nikitasius
    Author

    You must have enabled txindex at some point.

    I got what you mean, i had it in my logs.

    here is my laptop, prune 8Gb (so no txindex):

    This is nice improvement, you made it stable and predictable.

    But what about:

    • When user request tx by txid and do not setup blockhash, btc client look for this field itself.

    This improvement is possible? To avoid an additional API calls to RPC server (=wasting of time on processing).

  15. added a commit that references this issue on Jun 17, 2019
    fce4123
  16. locked as resolved and limited conversation to collaborators on Dec 16, 2021
  17. added a commit that references this issue on Dec 1, 2023
    4013db1
  18. added a commit that references this issue on Dec 9, 2023
    fa290fe
  19. added a commit that references this issue on Jul 19, 2026
    73d61d9
  20. added a commit that references this issue on Aug 30, 2026
    75275f1
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions