1

I got a block and asked for the data in its first transaction and that generated an error. The following is from the console tab in the Debug window:

10:52:52 getblock 000000000030bfd22ed67169b6bbf9ba994618fa9840642d395b56134f15176c

10:52:52
{
  "hash": "000000000030bfd22ed67169b6bbf9ba994618fa9840642d395b56134f15176c",
  "confirmations": 332460,
  "size": 216,
  "height": 81626,
  "version": 1,
  "merkleroot": "1ebda57ace225010d23d72619dbda5ee250dc4536f7c3428a9a419f06438ca54",
  "tx": [
    "1ebda57ace225010d23d72619dbda5ee250dc4536f7c3428a9a419f06438ca54"
  ],
  "time": 1285297753,
  "mediantime": 1285295165,
  "nonce": 71992579,
  "bits": "1b4766ed",
  "difficulty": 917.8307413015116,
  "chainwork": "00000000000000000000000000000000000000000000000000650ba70ddba016",
  "previousblockhash": "00000000001272fc0e0cfa9d08d854cfac681a939dccc21aecd9f7074fb0df2b",
  "nextblockhash": "00000000001bd5ac7329097b9888628c33c7adeecfc6e46f74fbab006f4c2127"
}

10:53:42 getrawtransaction 1ebda57ace225010d23d72619dbda5ee250dc4536f7c3428a9a419f06438ca54

10:53:42 No information available about transaction (code -5)

This happens in Bitcoin Classic and in Bitcoin Core. I don't have a bitcoin.conf file in the folder where bitcoin-qt.exe lives, but I do have one where the chainstate and blocks folders are located. It has five lines in it and each one starts with "addnode".

2

You need the transaction index enabled of you want to use getrawtransaction on arbitrary transactions. By default, only transactions that have unspent outputs are available.

Run bitcoind with -txindex or put txindex=1 in bitcoin.conf. You'll need to reindex.

  • I only do this to myself: Dave, RTFM! getrawtransaction "txid" ( verbose ) NOTE: By default this function only works sometimes. This is when the tx is in the mempool or there is an unspent output in the utxo for this transaction. To make it always work, you need to maintain a transaction index, using the -txindex command line option. – Dave Scotese May 31 '16 at 18:40
0

Hard to know without knowing your local machine state. My guess would be that you've downloaded the block headers (includes block information), but not the full blocks (which include transactions)

  • 1
    In that case, getblock would fail. – Pieter Wuille May 30 '16 at 21:41

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.