Bitcoin Forum

Bitcoin => Bitcoin Technical Support => Topic started by: ericools on February 18, 2014, 11:47:40 PM



Title: How do I recover the transaction history
Post by: ericools on February 18, 2014, 11:47:40 PM
I have a wallet file I use for my business transactions and when I opened and it started syncing the blockchain it would crash the client (qt linux, several versions over the last year).  Anyway I started a new wallet and moved all my coins to it.  Now that it's getting to be time to file my taxes I need a history of my bitcoin income and expenses. 

Is there a way for me to pull the transaction history out of my wallet.dat file?


I would also be interested to know if there is some way to export it from a working file.  I found one post that claimed it could be done, but I didn't see any way other than to manually retype it into a spreadsheet.

Thanks,


Title: Re: How do I recover the transaction history
Post by: DannyHamilton on February 19, 2014, 12:05:08 AM
If you still have the original wallet.dat file, and if it isn't horribly damaged, you should be able to use pywallet to pull the private keys out of it.

Then you can import those private keys into a new wallet.dat.  Once the new wallet finished scanning the blockchain you should see all your previous transactions.


Title: Re: How do I recover the transaction history
Post by: ericools on February 19, 2014, 12:53:10 AM
I actually did that at one point to get some funds that were sent to the old wallet by accident.  The thing is it didn't fix my issue the client still crashed, even when done on a separate computer.  I don't really understand why that would happen.  I would have thought the keys are either good nor not good and wouldn't affect the performance of the bitcoin client.

Looks like I will probably have to give it a try.  I was hoping the transaction history was stored in plain text in a file in my .bitcoin folder somewhere for easy copy pasting.


Title: Re: How do I recover the transaction history
Post by: DannyHamilton on February 19, 2014, 01:07:23 AM
I know that the transactions that you send are stored in wallet.dat (I can't remember if they are removed once they are confirmed, I'd have to check on that).  However, as best as I can remember, transactions that you receive are not stored in wallet.dat at all.

If you have a list of all the addresses you used, it wouldn't be very difficult to write a quick program that would pull the transaction history for each address from blockchain.info.


Title: Re: How do I recover the transaction history
Post by: ericools on February 19, 2014, 01:17:39 AM
I was assuming the whole transaction history was stored in the wallet.dat file, since when I manually swap my personal and business wallet.dat files and open the client they show their correct transaction histories.


Title: Re: How do I recover the transaction history
Post by: DannyHamilton on February 19, 2014, 01:25:05 AM
I was assuming the whole transaction history was stored in the wallet.dat file, since when I manually swap my personal and business wallet.dat files and open the client they show their correct transaction histories.

I'm pretty sure the wallet rescans the entire blockchain for transactions that match the addresses that are contained in the wallet.dat when you swap in a wallet.


Title: Re: How do I recover the transaction history
Post by: ksteve96 on February 19, 2014, 03:02:07 AM
I was assuming the whole transaction history was stored in the wallet.dat file, since when I manually swap my personal and business wallet.dat files and open the client they show their correct transaction histories.

I'm pretty sure the wallet rescans the entire blockchain for transactions that match the addresses that are contained in the wallet.dat when you swap in a wallet.

He's missing something though.  
OP, you need to fix your client before any of this matters.  It will rescan, it will show history. Your wallet file is fine, it's what you're running it with that is messed up.   Save your wallet somewhere safe, reinstall bitcoin, and import the original.  No reason to move coins, the problem will just repeat itself.

After you overcome this issue, you will see all of your transactions.   Making that a spreadsheet, though, is not directly possible through the client.  Figure out the first part, then make a new thread about how to extract tx logs from the blockchain.  


Title: Re: How do I recover the transaction history
Post by: ericools on February 19, 2014, 04:14:20 AM
I was assuming the whole transaction history was stored in the wallet.dat file, since when I manually swap my personal and business wallet.dat files and open the client they show their correct transaction histories.

I'm pretty sure the wallet rescans the entire blockchain for transactions that match the addresses that are contained in the wallet.dat when you swap in a wallet.

He's missing something though.  
OP, you need to fix your client before any of this matters.  It will rescan, it will show history. Your wallet file is fine, it's what you're running it with that is messed up.   Save your wallet somewhere safe, reinstall bitcoin, and import the original.  No reason to move coins, the problem will just repeat itself.

After you overcome this issue, you will see all of your transactions.   Making that a spreadsheet, though, is not directly possible through the client.  Figure out the first part, then make a new thread about how to extract tx logs from the blockchain.  


That does make sense that it would just grab that information from the blockchain.  It must just keep your address names.

I am sure it's the file that's bad and not the client.  I am not using the same computer, OS, or bitcoin client version that I originally had the issue with.  Prior to creating a new wallet I had copied the wallet to my laptop and had the same issues with it opening and syncing.