Author

Topic: How could I back scan the ledger to find a transaction to a specific address? (Read 509 times)

legendary
Activity: 3528
Merit: 4945
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.




newbie
Activity: 7
Merit: 0
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.
Jump to: