Bitcoin Forum
December 15, 2024, 02:52:30 PM *
News: Latest Bitcoin Core release: 28.0 [Torrent]
 
   Home   Help Search Login Register More  
Pages: [1]
  Print  
Author Topic: Why can't I get info on transactions from Core?  (Read 746 times)
jonnybravo0311 (OP)
Legendary
*
Offline Offline

Activity: 1344
Merit: 1024


Mine at Jonny's Pool


View Profile WWW
June 10, 2015, 06:47:09 PM
 #1

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?

Jonny's Pool - Mine with us and help us grow!  Support a pool that supports Bitcoin, not a hardware manufacturer's pockets!  No SPV cheats.  No empty blocks.
grue
Legendary
*
Offline Offline

Activity: 2058
Merit: 1462



View Profile
June 10, 2015, 07:10:10 PM
 #2

you need -txindex to view transactions that don't belong in your wallet.

It is pitch black. You are likely to be eaten by a grue.

Adblock for annoying signature ads | Enhanced Merit UI
jonnybravo0311 (OP)
Legendary
*
Offline Offline

Activity: 1344
Merit: 1024


Mine at Jonny's Pool


View Profile WWW
June 10, 2015, 07:32:07 PM
 #3

you need -txindex to view transactions that don't belong in your wallet.
Much obliged.  Thanks grue! Smiley

Jonny's Pool - Mine with us and help us grow!  Support a pool that supports Bitcoin, not a hardware manufacturer's pockets!  No SPV cheats.  No empty blocks.
Pages: [1]
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.19 | SMF © 2006-2009, Simple Machines Valid XHTML 1.0! Valid CSS!