Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bitcoin-QT 0.8.1 Windows client freezing when importing private-key. #2389

Closed
Herodes-otc opened this issue Mar 20, 2013 · 11 comments
Closed

Comments

@Herodes-otc
Copy link

Problem: Bitcoin-QT crash when importing a private key.

Bug report.

Bitcoin-QT version 0.8.1
Windows version:  Windows 7 professional 32-bit
Block-chain not downloaded completely - about 7K blocks left.

Action that cause the issue:

Help -> Debug window -> Console

Write help to get info about commands.

then


importprivkey privatekeyhere labelhere

or

importprivkey privatekeyhere

both makes the Debug window unresponsive when clicking it after the commands have finished. After clicking the X in the far right corner, windows says the program is non-responsive and asks if it should be shut down. I've tried waiting for a long time (several minutes) to see if it resolved itself, it didn't.

However after forcing a closedown of the program through the windows close down feature, and restarting the bitcoin client, the address appears to have been imported just fine. I haven't tried to send or receive any coins with the imported adresses yet. But I assume that would work.

When bitcoin-QT starts again, it takes a while and gives a message about verifying the block database integrity or something like that, I didn't note down exactly what it said.

Could the reason be that the client is rescanning ? I didn't ask it to rescan.

@Diapolo
Copy link

Diapolo commented Mar 20, 2013

Can you try what happens with this, when you are fully synced with the network and report back.

@Herodes-otc
Copy link
Author

Bitcoin-QT running, sitting in Overview pane.

Fully synched

Help -> Debug Window -> Console

Doing:

importprivkey privkey label
<enter>

No error message or ok message shown.

Closing Debug window

Going to Receive coins pane, the adress I imported is not showing up.

Closing down client.

Client wouldn't shut down, so I forcefully shut it down with task-manager.

Restarting Bitcoin-QT

Message: Verifying block database integrity...

Stands there for a while

Client done loading, clicking on Receive coins

The imported adress is now visible with the label I assigned to it.

Tried to send some coins to the recently imported adress, shows up in the client immediately, so it works.

Conclusion: This appears not to be a serious bug, and I'm aware that this 

is something that's done through the

Help -> Debug Window -> Console

so perhaps it's not meant to be a streamlined process ?

However - if this issue is not closed as a non-bug, I propose that when the blockchain 

is not in synch, that the client is prevented from crashing in regards to this issue. Also it
would be good to give some kind of feedback like 'Private key [key label] successfully
imported', you may need to restart the client for it to be visible. Also the error message
given when trying to importing the same private key twice gives an error message:

Error adding key to wallet (code -4).

Perhaps it would be possible to give a more human readable message that says: 

"The private key for [bitcoinaddress] is already imported."

I'm aware these are not serious issues, so let me know what you think.

Forgive me for this poorly formatted message, I'm unfamiliar with the github issue system.

@Herodes-otc
Copy link
Author

Hah - I managed to accidentally close the issue as well - well I reopened it now - I need input from others, please.

@Herodes-otc Herodes-otc reopened this Mar 20, 2013
@qubez
Copy link

qubez commented Mar 22, 2013

Importing a private key does immediately start a rescan, which when executed through the debug console will make the UI unresponsive until it completes. This is so the new balance will be shown correctly after importing a key. A progress or busy indicator would be useful when Bitcoin is performing an operation, even if started via RPC, so users don't shut down Bitcoin-Qt while it is performing some database operation.

There is an option that allows you to disable the automatic rescan, if for example you have many keys to import before you wish the rescan to happen.

importprivkey [label] [rescan=true]

@Viceroy
Copy link

Viceroy commented Jun 17, 2013

Same problem.

Windows Vista
Sometime on import all is well. Sometimes on import the wallet freezes. Chain is up to date.
v0.8.1-beta

1 private key !
2 private keys !
3 priv ____ BREAK (not responding)

force "close program"

Looking for newer...
now trying 8.2...

Nope. Same problem. Locked up after the third import.

So the solution is to wait? Is there any other way to import a batch of addresses? This seems awfully inefficient for a merchant.

@sipa
Copy link
Member

sipa commented Jun 17, 2013

After importing a new key, the blockchain is rescanned for missing transactions. This may take 10 minutes or so, depending on hardware. You can disable rescanning by passing an extra 'false' argument to the RPC call, so for example

importprivkey 5wkf297rdkhviutt29423587y764928468725 false

I've also been working on an "entire wallet" key export/import function, which would export all wallet keys to a file, or import such a file at once.

May I ask why you need to import many keys, though?

@Viceroy
Copy link

Viceroy commented Jun 18, 2013

So I've imported the private keys per sipa's method and while the solution worked perfectly I later realized that the addresses show up differently in my wallet that I had expected... they show up under the "addresses" tab. ;-)

Perhaps I am not doing what I should be doing. My entire purpose is to create a new public address for each transaction the same way mt gox appears to do each time I deposit btc into my account. If the key system is any type of modulus system is it not true that a single private key could have many public solutions? If that is the case... how to I create a batch new public keys from the "original" private key within or outside my wallet? I would like to create:

1publicaddress12345
1sumutherpublicaddress12345
1sumutherpublicaddress12346
1sumutherpublicaddress12347

I expected these to show up under "Receive" so I'm now thinking that I wanted to create new public addresses from the existing key instead of new keys which seem to be called addresses. Is this right?

My solution was to use vanitygen + import the newly pressed keys. But I don't think I want/need all the private keys. Thoughts? Better place to ask? (I don't need vanity addresses, just unique ones with a zero balance).

@sipa
Copy link
Member

sipa commented Jun 18, 2013

Every private key has exactly one corresponding public key and address.

But why are you importing keys at all? Just do a getnewaddress every time you need a new receive address?

@Viceroy
Copy link

Viceroy commented Jun 18, 2013

"Just do a getnewaddress every time you need a new receive address"

This is the information I needed, thank you.

@laanwj
Copy link
Member

laanwj commented Oct 24, 2013

Closing this as it appears to be sufficiently answered.

@laanwj laanwj closed this as completed Oct 24, 2013
@staplezjay
Copy link

how do i get my coins if i closed because i thought it froze

@bitcoin bitcoin locked as resolved and limited conversation to collaborators Sep 8, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

7 participants