Changeset View
Changeset View
Standalone View
Standalone View
src/wallet/scriptpubkeyman.cpp
Show First 20 Lines • Show All 361 Lines • ▼ Show 20 Lines | bool LegacyScriptPubKeyMan::Upgrade(int prev_version, std::string &error) { | ||||
return true; | return true; | ||||
} | } | ||||
bool LegacyScriptPubKeyMan::HavePrivateKeys() const { | bool LegacyScriptPubKeyMan::HavePrivateKeys() const { | ||||
LOCK(cs_KeyStore); | LOCK(cs_KeyStore); | ||||
return !mapKeys.empty() || !mapCryptedKeys.empty(); | return !mapKeys.empty() || !mapCryptedKeys.empty(); | ||||
} | } | ||||
void LegacyScriptPubKeyMan::RewriteDB() { | |||||
AssertLockHeld(cs_wallet); | |||||
setInternalKeyPool.clear(); | |||||
setExternalKeyPool.clear(); | |||||
m_pool_key_to_index.clear(); | |||||
// Note: can't top-up keypool here, because wallet is locked. | |||||
// User will be prompted to unlock wallet the next operation | |||||
// that requires a new key. | |||||
} | |||||
static int64_t GetOldestKeyTimeInPool(const std::set<int64_t> &setKeyPool, | static int64_t GetOldestKeyTimeInPool(const std::set<int64_t> &setKeyPool, | ||||
WalletBatch &batch) { | WalletBatch &batch) { | ||||
if (setKeyPool.empty()) { | if (setKeyPool.empty()) { | ||||
return GetTime(); | return GetTime(); | ||||
} | } | ||||
CKeyPool keypool; | CKeyPool keypool; | ||||
int64_t nIndex = *(setKeyPool.begin()); | int64_t nIndex = *(setKeyPool.begin()); | ||||
▲ Show 20 Lines • Show All 1,030 Lines • Show Last 20 Lines |