Author

Topic: Why can't I get info on transactions from Core? (Read 738 times)

legendary
Activity: 1344
Merit: 1024
Mine at Jonny's Pool
you need -txindex to view transactions that don't belong in your wallet.
Much obliged.  Thanks grue! Smiley
legendary
Activity: 2058
Merit: 1452
you need -txindex to view transactions that don't belong in your wallet.
legendary
Activity: 1344
Merit: 1024
Mine at Jonny's Pool
So, as a fun side project I decided to write some code to traverse the blockchain and look for "empty" blocks.  An empty block is one that contains only a single transaction - the coinbase transaction that awards the generated coins.  Not surprisingly, a whole bunch of the early blocks are indeed empty.

However, what truly surprised me is when I tried to parse the transactions.  For a very large number of transactions, Bitcoin Core just doesn't return anything useful.  Here's an example below for block 337104:

Code:
getblockhash 337104
00000000000000000cc790ec61cd20d394f9d0f0c3e34adb1005d2d909b3f691
Code:
getblock 00000000000000000cc790ec61cd20d394f9d0f0c3e34adb1005d2d909b3f691

{
"hash" : "00000000000000000cc790ec61cd20d394f9d0f0c3e34adb1005d2d909b3f691",
"confirmations" : 23233,
"size" : 256,
"height" : 337104,
"version" : 2,
"merkleroot" : "57224de458d9356a471099c5ab9f5e68f395ec5f2822915bdf3c6b296c1428e2",
"tx" : [
"57224de458d9356a471099c5ab9f5e68f395ec5f2822915bdf3c6b296c1428e2"
],
"time" : 1420197655,
"nonce" : 3357110901,
"bits" : "181b0dca",
"difficulty" : 40640955016.57649231,
"chainwork" : "00000000000000000000000000000000000000000003beb652b37a2f4b948166",
"previousblockhash" : "00000000000000001654d3aa9abac3e815391b9b5eca90e15767cc1ee6ce1dc2",
"nextblockhash" : "00000000000000001686943c32233916b9d9485230bf63fc0f9144c94be4c1af"
}
Code:
getrawtransaction 57224de458d9356a471099c5ab9f5e68f395ec5f2822915bdf3c6b296c1428e2 1
No information available about transaction (code -5)

The key piece is that last call about the transaction.  Core doesn't know anything about it.

Yet, if I look at that same transaction on blockchain.info I can see it clearly, and can parse the coinbase script to see the block was mined by Discus Fish:
 �$七彩神仙鱼��mmvs��̮���M���,���w, z1FaW���fZ�rMined by andy518038

Anyone have any idea?
Jump to: