Trying to import a private key into bitcoind

4

I am in a special situation where I need to import my private key credentials and basically restore a wallet to bitcoind. bitcoind is running and I do have an rpc user/pass and server=1 in the bitcoind.conf, but no matter what I do, when I try and import the key I get the following error. There is no password nor encryption on the wallet.

root@coined:/home#  bitcoind importprivkey "5JxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxHjdCia9dt7" "root"
error: {"code":-4,"message":"Error adding key to wallet"}

dooode

Posted 2014-02-18T04:08:40.057

Reputation: 529

Are there any useful messages in debug.log? Also, FYI, if you run this on the command line, your private key is probably now logged in your shell's history file (perhaps ~root/.bash_history).Nate Eldredge 2014-02-18T15:30:51.310

If you typed it up manually, you might have a typo in there or are missing a character? I once had a uppercase "S" instead of lowercase "s" in something and it took me forever to find it.Murch 2014-02-19T10:23:38.847

@Murch copy/pastedooode 2014-02-19T22:36:58.247

Answers

1

Without anything in the log, it's difficult to day. But here are a few suggestions what could try to find out the cause of the error:

  • Do you have write permission on the wallet.dat file in your .bitcoin directory?
  • Is the wallet locked with a passphrase? Then you need to unlock it (would probably give another error message but worth asking).
  • Did you set the disablewallet option either in command line or configuration file?
  • Is your wallet possibly locked due to a -reindex operation?

guggero

Posted 2014-02-18T04:08:40.057

Reputation: 11

-2

leave away the "" around the key (and the label)?

dego

Posted 2014-02-18T04:08:40.057

Reputation: 1

Same issue with or without the quotes.dooode 2014-02-18T10:56:57.863

Not a trace of the error in /root/.bitcoin/debug.log :(dooode 2014-02-18T20:05:06.680

I have tried with a new user as well.dooode 2014-02-18T20:05:38.823