* Mark old keypool keys as used, * and generate all new keys */
| 3559 | * and generate all new keys |
| 3560 | */ |
| 3561 | bool CWallet::NewKeyPool() |
| 3562 | { |
| 3563 | { |
| 3564 | LOCK(cs_wallet); |
| 3565 | CWalletDB walletdb(strWalletFile); |
| 3566 | for (int64_t nIndex : setInternalKeyPool) { |
| 3567 | walletdb.ErasePool(nIndex); |
| 3568 | } |
| 3569 | setInternalKeyPool.clear(); |
| 3570 | for (int64_t nIndex : setExternalKeyPool) { |
| 3571 | walletdb.ErasePool(nIndex); |
| 3572 | } |
| 3573 | setExternalKeyPool.clear(); |
| 3574 | nKeysLeftSinceAutoBackup = 0; |
| 3575 | // m_pool_key_to_index.clear(); |
| 3576 | // darkSendClient.fEnableDarkSend = false; |
| 3577 | |
| 3578 | if (!TopUpKeyPool()) { |
| 3579 | return false; |
| 3580 | } |
| 3581 | LogPrintf("CWallet::NewKeyPool rewrote keypool\n"); |
| 3582 | } |
| 3583 | return true; |
| 3584 | } |
| 3585 | |
| 3586 | size_t CWallet::KeypoolCountExternalKeys() |
| 3587 | { |