MCPcopy Create free account
hub / github.com/LUX-Core/lux / MarkReserveKeysAsUsed

Method MarkReserveKeysAsUsed

src/wallet.cpp:3975–3995  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

3973}
3974
3975void CWallet::MarkReserveKeysAsUsed(int64_t keypool_id)
3976{
3977 AssertLockHeld(cs_wallet);
3978 bool internal = setInternalKeyPool.count(keypool_id);
3979 if (!internal) assert(setExternalKeyPool.count(keypool_id));
3980 std::set<int64_t> *setKeyPool = internal ? &setInternalKeyPool : &setExternalKeyPool;
3981 auto it = setKeyPool->begin();
3982
3983 CWalletDB walletdb(strWalletFile);
3984 while (it != std::end(*setKeyPool)) {
3985 const int64_t& index = *(it);
3986 if (index > keypool_id) break; // set*KeyPool is ordered
3987
3988 CKeyPool keypool;
3989 if (walletdb.ReadPool(index, keypool)) {
3990 m_pool_key_to_index.erase(keypool.vchPubKey.GetID());
3991 }
3992 walletdb.ErasePool(index);
3993 it = setKeyPool->erase(it);
3994 }
3995}
3996
3997void CReserveKey::ReturnKey()
3998{

Callers

nothing calls this directly

Calls 7

endFunction · 0.85
ReadPoolMethod · 0.80
ErasePoolMethod · 0.80
countMethod · 0.45
beginMethod · 0.45
eraseMethod · 0.45
GetIDMethod · 0.45

Tested by

no test coverage detected