Bitcoin Forum
May 25, 2024, 04:35:20 PM *
News: Latest Bitcoin Core release: 27.0 [Torrent]
 
   Home   Help Search Login Register More  
Pages: [1]
  Print  
Author Topic: regarding: bitcoind's memory of spent transactions  (Read 466 times)
Cinnamon Cayenne (OP)
Newbie
*
Offline Offline

Activity: 18
Merit: 0



View Profile
November 23, 2013, 11:55:49 PM
 #1

I had thought it would be possible to navigate the river of Bitcoin history via the RPC API.

For block headers, it seems, this is true:
Code:
$ getblock 000000001c920d495e1eeef2452b6d1c6c229a919b28196c103ecffebabee141
{
    "hash" : "000000001c920d495e1eeef2452b6d1c6c229a919b28196c103ecffebabee141",
    "confirmations" : 78106,
    "size" : 647,
    "height" : 50001,
    "version" : 1,
    "merkleroot" : "ee3a2d2b895cafacff526d06a55b55e049cf84a9735e4a63f7fd08f96d0f4649",
    "tx" : [
        "e1882d41800d96d0fddc196cd8d3f0b45d65b030c652d97eaba79a1174e64d58",
        "7940cdde4d713e171849efc6bd89939185be270266c94e92369e3877ad89455a",
        "f84761459a00c6df3176ae5d94c99e69f25100d09548e5686bd0c354bb8cc60a"
    ],
    "time" : 1270917100,
    "nonce" : 56717043,
    "bits" : "1c2a1115",
    "difficulty" : 6.08547691,
    "previousblockhash" : "000000001aeae195809d120b5d66a39c83eb48792e068f8ea1fea19d84a4278a",
    "nextblockhash" : "000000002066d7f9b134c30b5005b7bf5fbfa52f279883f1fde793dcdc964266"
}
However, should I dig deeper...
Code:
$ getrawtransaction e1882d41800d96d0fddc196cd8d3f0b45d65b030c652d97eaba79a1174e64d58
01000000010000000000000000000000000000000000000000000000000000000000000000ffffffff080415112a1c02cc00ffffffff0100f2052a01000000434104c1b5671c8975087cc796d6ea73d2407591528b5c669106f9b6ab6ef6e373a57553e14866aaeffc44a9f58e5ee0c7faa7add7474f0a2c55a22cb40b949fdc933cac00000000
Code:
$ getrawtransaction 7940cdde4d713e171849efc6bd89939185be270266c94e92369e3877ad89455a
error: {"code":-5,"message":"No information available about transaction"}
The pattern, of course, is that the first transaction's outputs remain unspent, whereas the second transaction's coins have long since moved elsewhere.

If historical, spent transaction data can be queried via another interface in the reference client, or if there is another client that can provide it, I should very much like to know.
gmaxwell
Staff
Legendary
*
Offline Offline

Activity: 4186
Merit: 8426



View Profile WWW
November 24, 2013, 01:00:10 AM
 #2

Add txindex=1 to your bitcoin.conf, and restart bitcoin with -reindex.  It will rebuild your database with an index of all transactions. Adds about 1.4Gbytes of required storage.
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!