Bitcoin Forum
September 27, 2018, 11:24:47 PM *
News: ♦♦ New info! Bitcoin Core users absolutely must upgrade to previously-announced 0.16.3 [Torrent]. All Bitcoin users should temporarily trust confirmations slightly less. More info.
 
   Home   Help Search Donate Login Register  
Pages: [1]
  Print  
Author Topic: How could I back scan the ledger to find a transaction to a specific address?  (Read 405 times)
marley
Newbie
*
Offline Offline

Activity: 7
Merit: 0


View Profile
June 11, 2014, 10:17:00 PM
 #1

How could I do this in the bitcoin client?
Are there any API to search for transactions?
I'm not interested on how to do this manually, but instead on how to add this as a feature in the bitcoin client.
1538090687
Hero Member
*
Offline Offline

Posts: 1538090687

View Profile Personal Message (Offline)

Ignore
1538090687
Reply with quote  #2

1538090687
Report to moderator
Advertised sites are not endorsed by the Bitcoin Forum. They may be unsafe, untrustworthy, or illegal in your jurisdiction. Advertise here.
DannyHamilton
Legendary
*
Offline Offline

Activity: 2198
Merit: 1373



View Profile
June 11, 2014, 10:56:48 PM
 #2

How could I do this in the bitcoin client?

Are there any API to search for transactions?

Set txindex=1 in the bitcoin.conf file.
Run the client with -reindex


For every number between 1 and the current block height:

    getblockhash [index]
    getblock [blockhash]

    For each transactionID returned by getblock

        getrawtransaction [transactionID]
        decoderawtransaction [rawtransaction]

        For each output in the JSON vout[] array

            Compare the value associated with the "addresses" tag to see if it matches the address you are looking for.


You can write a program to do this if you don't want to do it manually.





Pages: [1]
  Print  
 
Jump to:  

Sponsored by , a Bitcoin-accepting VPN.
Powered by MySQL Powered by PHP Powered by SMF 1.1.19 | SMF © 2006-2009, Simple Machines Valid XHTML 1.0! Valid CSS!