MCPcopy Create free account
hub / github.com/BTCGPU/BTCGPU / NewKeyPool

Method NewKeyPool

src/wallet/wallet.cpp:3286–3318  ·  view source on GitHub ↗

* Mark old keypool keys as used, * and generate all new keys */

Source from the content-addressed store, hash-verified

3284 * and generate all new keys
3285 */
3286bool CWallet::NewKeyPool()
3287{
3288 if (IsWalletFlagSet(WALLET_FLAG_DISABLE_PRIVATE_KEYS)) {
3289 return false;
3290 }
3291 {
3292 LOCK(cs_wallet);
3293 WalletBatch batch(*database);
3294
3295 for (int64_t nIndex : setInternalKeyPool) {
3296 batch.ErasePool(nIndex);
3297 }
3298 setInternalKeyPool.clear();
3299
3300 for (int64_t nIndex : setExternalKeyPool) {
3301 batch.ErasePool(nIndex);
3302 }
3303 setExternalKeyPool.clear();
3304
3305 for (int64_t nIndex : set_pre_split_keypool) {
3306 batch.ErasePool(nIndex);
3307 }
3308 set_pre_split_keypool.clear();
3309
3310 m_pool_key_to_index.clear();
3311
3312 if (!TopUpKeyPool()) {
3313 return false;
3314 }
3315 WalletLogPrintf("CWallet::NewKeyPool rewrote keypool\n");
3316 }
3317 return true;
3318}
3319
3320size_t CWallet::KeypoolCountExternalKeys()
3321{

Callers 2

sethdseedFunction · 0.80
BOOST_AUTO_TEST_CASEFunction · 0.80

Calls 2

ErasePoolMethod · 0.80
clearMethod · 0.45

Tested by 1

BOOST_AUTO_TEST_CASEFunction · 0.64