Bitcoin Forum
May 02, 2024, 10:12:03 PM *
News: Latest Bitcoin Core release: 27.0 [Torrent]
 
   Home   Help Search Login Register More  
Pages: [1]
  Print  
Author Topic: How could I back scan the ledger to find a transaction to a specific address?  (Read 476 times)
marley (OP)
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.
1714687923
Hero Member
*
Offline Offline

Posts: 1714687923

View Profile Personal Message (Offline)

Ignore
1714687923
Reply with quote  #2

1714687923
Report to moderator
1714687923
Hero Member
*
Offline Offline

Posts: 1714687923

View Profile Personal Message (Offline)

Ignore
1714687923
Reply with quote  #2

1714687923
Report to moderator
1714687923
Hero Member
*
Offline Offline

Posts: 1714687923

View Profile Personal Message (Offline)

Ignore
1714687923
Reply with quote  #2

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

Activity: 3388
Merit: 4613



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:  

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