<p>Keypool keys are already in <code>wallet.dat</code>.  That's the whole point of the keypool.  When you run <code>getnewaddress</code>, you get the address corresponding to the oldest key in the keypool, and a new key is generated and added to the keypool to take its place.</p>

<p>So if your hypothesis is right, the key is still in the keypool, and if you execute <code>getnewaddress</code> again, you should get the same address as you got before.  Then you'll know you have the key.  <code>bitcoind</code> may not expect that there are already transactions on that address, so you might have to run <code>bitcoind -rescan</code> to pick them up.</p>

CC BY-SA 3.0
2017-03-01T15:16:59.970Z
2017-03-01T15:16:59.970Z
Nate Eldredge
<p>So, I generated a new address with <code>getnewaddress</code> and made a payment to it. Soon after the computer bitcoind ran on shut down (due to loss of power) and after booting it up again my wallet doesn't know of the address anymore. I'm assuming all that happened was that the newly generated address wasn't written to disk in time. But the keys should still be in the keypool, right? How do I restore the keys and import them into the wallet? I still have the address.</p>

<private-key><keypool>
Restore keys from keypool
user46757
# Restore keys from keypool

(Asked by: username_0 on 2017-03-01)

So, I generated a new address with `getnewaddress` and made a payment to it. Soon after the computer bitcoind ran on shut down (due to loss of power) and after booting it up again my wallet doesn't know of the address anymore. I'm assuming all that happened was that the newly generated address wasn't written to disk in time. But the keys should still be in the keypool, right? How do I restore the keys and import them into the wallet? I still have the address.

**Tags:** private-key, keypool


---

## 1 answers

### Answer by username_1 on 2017-03-01. Score: 1

Keypool keys are already in `wallet.dat`. That's the whole point of the keypool. When you run `getnewaddress`, you get the address corresponding to the oldest key in the keypool, and a new key is generated and added to the keypool to take its place.

So if your hypothesis is right, the key is still in the keypool, and if you execute `getnewaddress` again, you should get the same address as you got before. Then you'll know you have the key. `bitcoind` may not expect that there are already transactions on that address, so you might have to run `bitcoind -rescan` to pick them up.


---

