<p>To supplement George's answer:</p>

<p>It would help if you would clarify what you mean by "crash" and describe exactly what happens.  (To many people, "crash" means a segfault or similar abnormal termination, but it sounds like that's not what you mean.)</p>

<p>If the issue is that the program appears unresponsive, this is normal: it's a well-known annoyance (perhaps not exactly a bug) in bitcoin-qt.  The program needs to rescan the transaction ledger (block chain) to find any previous transactions involving the newly imported address.  Unfortunately, while doing so it does not accept input from the GUI, report its progress, or redraw its window, which makes it look like the program has hung.  However, it should finish eventually if you don't kill it.</p>

<p>On my computer (laptop circa 2012 with SSD), rescanning takes 5-10 minutes.  Depending on the performance of your computer and especially your hard drive, it could take substantially longer.  I would give it at least an hour or two before assuming it is really hung.  You may also be able to see in your system's status monitor that the bitcoin-qt client is using CPU and/or doing disk I/O, which should indicate it is still working on the rescan.</p>

<p>As George suggests, you can disable the rescan using the <code>rescan=false</code> option.  However, this is usually not a good idea.  If you do so, bitcoin-qt will not know about any previous transactions on this address; in particular, if the address contains coins, bitcoin-qt will not know about this, will not update your balance to include them, and will not let you spend them.  Since the most common reason to import a private key is to claim coins that it contains, this would defeat the purpose.</p>

<p>If you know the address has never been used before (e.g. it is a vanity address you have just generated), then it is fine to use <code>rescan=false</code>, since there are no previous transactions to be found.</p>

<p>If you have several private keys to import, you can use <code>rescan=false</code> for all but the last one, to save time.  When a rescan is done, it searches for transactions for all addresses in the wallet, both old and new.  You can also force a rescan later by quitting bitcoin-qt and restarting it with the <code>-rescan</code> flag; again, it will appear to be hung for a while as it rescans, and the GUI window may not appear until it is done.</p>

CC BY-SA 3.0
2014-08-17T22:13:29.147Z
2014-08-17T22:13:29.147Z
Nate Eldredge
<p>Importing a private using the debug console causes a crash, I always have to kill from shell the bitcoin-qt app and restart it.
Is there any way to prevent this? 
Is there a way to import the private key into qt client from shell?</p>

CC BY-SA 3.0
2014-07-17T09:46:27.633Z
Which version are you using? On which operating system?
Emre K.
<bitcoin-core><import><rescan>
Bitcoin-qt import private key crash
Damiano Barbati
# Bitcoin-qt import private key crash

(Asked by: username_0 on 2014-07-17)

Importing a private using the debug console causes a crash, I always have to kill from shell the bitcoin-qt app and restart it.
Is there any way to prevent this?
Is there a way to import the private key into qt client from shell?

**Tags:** bitcoin-core, import, rescan

> **Comments:**
> **username_1**: Which version are you using? On which operating system?  

---

## 1 answers

### Answer by username_2 on 2014-08-17. Score: 2 | Accepted answer

To supplement George's answer:

It would help if you would clarify what you mean by "crash" and describe exactly what happens. (To many people, "crash" means a segfault or similar abnormal termination, but it sounds like that's not what you mean.)

If the issue is that the program appears unresponsive, this is normal: it's a well-known annoyance (perhaps not exactly a bug) in bitcoin-qt. The program needs to rescan the transaction ledger (block chain) to find any previous transactions involving the newly imported address. Unfortunately, while doing so it does not accept input from the GUI, report its progress, or redraw its window, which makes it look like the program has hung. However, it should finish eventually if you don't kill it.

On my computer (laptop circa 2012 with SSD), rescanning takes 5-10 minutes. Depending on the performance of your computer and especially your hard drive, it could take substantially longer. I would give it at least an hour or two before assuming it is really hung. You may also be able to see in your system's status monitor that the bitcoin-qt client is using CPU and/or doing disk I/O, which should indicate it is still working on the rescan.

As George suggests, you can disable the rescan using the `rescan=false` option. However, this is usually not a good idea. If you do so, bitcoin-qt will not know about any previous transactions on this address; in particular, if the address contains coins, bitcoin-qt will not know about this, will not update your balance to include them, and will not let you spend them. Since the most common reason to import a private key is to claim coins that it contains, this would defeat the purpose.

If you know the address has never been used before (e.g. it is a vanity address you have just generated), then it is fine to use `rescan=false`, since there are no previous transactions to be found.

If you have several private keys to import, you can use `rescan=false` for all but the last one, to save time. When a rescan is done, it searches for transactions for all addresses in the wallet, both old and new. You can also force a rescan later by quitting bitcoin-qt and restarting it with the `-rescan` flag; again, it will appear to be hung for a while as it rescans, and the GUI window may not appear until it is done.


---

