`getrawtransaction` do not return coinbase tx #4761

issue kostaz opened this issue on August 24, 2014
  1. kostaz commented at 9:18 AM on August 24, 2014: contributor

    For example:

    Let's get raw block number 308252. Check here at blockchain.info

    ./src/bitcoin-cli -rpcpassword=123456 getblock 00000000000000004381107684bba18bdf7de565f4c630c3f32ca1d6ada1b966 | head
    {
        "hash" : "00000000000000004381107684bba18bdf7de565f4c630c3f32ca1d6ada1b966",
        "confirmations" : 6967,
        "size" : 248317,
        "height" : 308252,
        "version" : 2,
        "merkleroot" : "be873c28ddfe66240d254820a9ee07e780c54c59b5e075e3681e18c87615d6f0",
        "tx" : [
            "66737352ec2343a836a360eb72055f92e9e805849185fc7735c37ca250d22303",
            "8c7b78026724d6136e48c09103bd5ddbd3ec9dc3c81e68c574f76fb3fa4a82b2",
    

    Regular tx getrawtransaction

    Works ok as seen below:

    $ ./src/bitcoin-cli -rpcpassword=123456 getrawtransaction 8c7b78026724d6136e48c09103bd5ddbd3ec9dc3c81e68c574f76fb3fa4a82b2
    01000000010f24db9b97f3b1194aacd2a8925476d4823c9b4ea5a8b58a37d273276c815344000000006c493046022100ac1ee528240ab39a34a9155d10540b5ac8c9f965295730a182a14bb3139d2546022100a80d2943c7d996b96ae20ac97e71ec8ec5f1932db2a997788223d05b54136f340121039c4783ec8cdac3bc70f3ae70762fd79f66ace8687b890d1f0225f7c22428aef9ffffffff0260359f65010000001976a91441028f8cba2827f2a846fa2f594a79d53b05597f88ac905f0100000000001976a9143753f953d92a61c307085266154c7003ef55b24488ac00000000
    

    Coinbase tx getrawtransaction

    Fails :-(

    $ ./src/bitcoin-cli -rpcpassword=123456 getrawtransaction 66737352ec2343a836a360eb72055f92e9e805849185fc7735c37ca250d22303
    error: {"code":-5,"message":"No information available about transaction"}
    
  2. sipa commented at 12:43 PM on August 24, 2014: member

    By default, getrawtransaction only works for not-fully-spent transactions, as no information is maintained about others. If you want to query for any transaction (including fully spent ones), run bitcoind with -txindex.

  3. sipa closed this on Aug 24, 2014

  4. 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 06:15 UTC

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