Bitcoin Forum

Bitcoin => Bitcoin Technical Support => Topic started by: xibeijan on February 09, 2014, 10:07:11 AM



Title: Help - importing private key - broke it
Post by: xibeijan on February 09, 2014, 10:07:11 AM
Quote
Import Private key(s)

The last command unlocked your wallet temporarily for 120 seconds, during which time you must import your private keys. Since private keys can be as important as your passphrase, you may want to use the same techniques as above to prevent their being recorded in bash history (bash variable or space before the command):
(space)bitcoind importprivkey "5yourveryveryveryverylongprivatekeystring" "my-new-key"  # "my-new-key" is a label for the key/address pair and is optional
The importing process is now started. Bitcoind will rescan the entire block data to ensure this key has not been used before. This process will take from one to two minutes, depending on your CPU performance. DO NOT abort it before finishing!

I have stupidly aborted an importprivkey operation.  :(

Now I cannot add the private key.  Returns error: {"code":-4,"message":"Error adding key to wallet"}

Is my wallet now damaged?  How can I fix this?


Title: Re: Help - importing private key - broke it
Post by: minzie on February 09, 2014, 02:04:02 PM
I took a peek at the source code. The error maps back to an "Unspecified problem with the wallet", so yes, it looks like there may be a problem with your wallet. Have you checked the debug log?

Also, a 'Recover' function available in the source, but I am not having much luck in determining whether there is a means to invoke that from the command line.


Title: Re: Help - importing private key - broke it
Post by: xibeijan on February 09, 2014, 08:50:59 PM
I took a peek at the source code. The error maps back to an "Unspecified problem with the wallet", so yes, it looks like there may be a problem with your wallet. Have you checked the debug log?

Also, a 'Recover' function available in the source, but I am not having much luck in determining whether there is a means to invoke that from the command line.

Thanks.  I am going to try to backup and restore my wallet.  Worth a shot.


Title: Re: Help - importing private key - broke it
Post by: xibeijan on February 09, 2014, 11:23:54 PM
I took a peek at the source code. The error maps back to an "Unspecified problem with the wallet", so yes, it looks like there may be a problem with your wallet. Have you checked the debug log?

Also, a 'Recover' function available in the source, but I am not having much luck in determining whether there is a means to invoke that from the command line.

Thanks.  I am going to try to backup and restore my wallet.  Worth a shot.

For anyone else running into this problem, backing up the wallet and restoring it fixed the issue for me.