4

I have ~5 BTC on an old laptop (Windows 7) and I tried moving the balance to another client. At first I tried moving about 0.1 BTC just to see what would happen. The client debitted the balance but it never "took" (that is, I never received the 0.1 BTC, and I know it is a good address). The client informed me I should update immediately so I updated to the latest version (v 0.8.0). The client would not load the wallet so I googled around and found a solution that said try to move all the files out of this directory EXCEPT for wallet.dat:

c:\Users[Me]\AppData\Roaming\Bitcoin

I made a copy of this folder elsewhere and emptied all the files except for wallet.dat, and I am now downloading the blockchain. However, intermittently I get this error:

System error: CDB(): can't open database file wallet.dat, error -30974

The error is thrown by this part of bitcoin's code.

ret = pdb->open(NULL,      // Txn pointer
                        fMockDb ? NULL : pszFile,   // Filename
                        fMockDb ? pszFile : "main", // Logical db name
                        DB_BTREE,  // Database type
                        nFlags,    // Flags
                        0);
// snip 7 lines
throw runtime_error(strprintf("CDB() : can't open database file %s, error %d", pszFile, ret));

Which causes the client to close. Right now I am simply re-opening bitcoin, where it will run for awhile (download a maybe a few hundred blocks or so) and then close again.

So the current issues are:
1. The 0.1 BTC I mentioned above is still showing as being debited from the total inside the local bitcoin client though there is no receipt at the receiving address, and this is confirmed by blockchain.info
2. I cannot create a new address to send coins
3. The client will not load the blockchain without indicating the error above and closing

1
  • Could it be permission related?
    – Colin Dean
    Mar 10, 2013 at 15:50

1 Answer 1

4

Your wallet.dat hold the keys. If the client is intermittently seeing errors you will not want to continue using it.

You essentially want to create a new, empty wallet and then import the keys into the new wallet.

One approach is to use Blockchain.info/wallet which can import the wallet.dat, and then you can export the keys from their web interface.

If that doesn't work, then you can try running the client (with no blockchain data files and no network connectivity) and from the Debug console export (dump) the private keys.

Another approach is to use joric's pywallet tool to export the keys.

1
  • you save my life! thanks ! the 2 command to rescue this issue are: 1. dumpprivkey 2 . importprivkey
    – temple
    Aug 3, 2016 at 17:07

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.