Changeset View
Changeset View
Standalone View
Standalone View
src/wallet/wallet.cpp
Show First 20 Lines • Show All 3,999 Lines • ▼ Show 20 Lines | while (it != std::end(*setKeyPool)) { | ||||
CKeyPool keypool; | CKeyPool keypool; | ||||
if (batch.ReadPool(index, keypool)) { | if (batch.ReadPool(index, keypool)) { | ||||
// TODO: This should be unnecessary | // TODO: This should be unnecessary | ||||
m_pool_key_to_index.erase(keypool.vchPubKey.GetID()); | m_pool_key_to_index.erase(keypool.vchPubKey.GetID()); | ||||
} | } | ||||
LearnAllRelatedScripts(keypool.vchPubKey); | LearnAllRelatedScripts(keypool.vchPubKey); | ||||
batch.ErasePool(index); | batch.ErasePool(index); | ||||
LogPrintf("keypool index %d removed\n", index); | |||||
it = setKeyPool->erase(it); | it = setKeyPool->erase(it); | ||||
} | } | ||||
} | } | ||||
bool CWallet::HasUnusedKeys(size_t min_keys) const { | |||||
return setExternalKeyPool.size() >= min_keys && | |||||
(setInternalKeyPool.size() >= min_keys || | |||||
!CanSupportFeature(FEATURE_HD_SPLIT)); | |||||
} | |||||
void CWallet::GetScriptForMining(std::shared_ptr<CReserveScript> &script) { | void CWallet::GetScriptForMining(std::shared_ptr<CReserveScript> &script) { | ||||
std::shared_ptr<CReserveKey> rKey = std::make_shared<CReserveKey>(this); | std::shared_ptr<CReserveKey> rKey = std::make_shared<CReserveKey>(this); | ||||
CPubKey pubkey; | CPubKey pubkey; | ||||
if (!rKey->GetReservedKey(pubkey)) { | if (!rKey->GetReservedKey(pubkey)) { | ||||
return; | return; | ||||
} | } | ||||
script = rKey; | script = rKey; | ||||
▲ Show 20 Lines • Show All 749 Lines • Show Last 20 Lines |