Changeset View
Changeset View
Standalone View
Standalone View
src/wallet/wallet.cpp
Show First 20 Lines • Show All 3,679 Lines • ▼ Show 20 Lines | // Return to key pool | ||||
m_pool_key_to_index[pubkey.GetID()] = nIndex; | m_pool_key_to_index[pubkey.GetID()] = nIndex; | ||||
} | } | ||||
LogPrintf("keypool return %d\n", nIndex); | LogPrintf("keypool return %d\n", nIndex); | ||||
} | } | ||||
bool CWallet::GetKeyFromPool(CPubKey &result, bool internal) { | bool CWallet::GetKeyFromPool(CPubKey &result, bool internal) { | ||||
CKeyPool keypool; | CKeyPool keypool; | ||||
{ | |||||
jasonbcox: This neither matches the backport PR nor provides any value by scoping the entire function. | |||||
nakihitoAuthorUnsubmitted Done Inline ActionsReverted. nakihito: Reverted. | |||||
LOCK(cs_wallet); | LOCK(cs_wallet); | ||||
int64_t nIndex = 0; | int64_t nIndex = 0; | ||||
ReserveKeyFromKeyPool(nIndex, keypool, internal); | ReserveKeyFromKeyPool(nIndex, keypool, internal); | ||||
if (nIndex == -1) { | if (nIndex == -1) { | ||||
if (IsLocked()) { | if (IsLocked()) { | ||||
return false; | return false; | ||||
} | } | ||||
CWalletDB walletdb(*dbw); | CWalletDB walletdb(*dbw); | ||||
result = GenerateNewKey(walletdb, internal); | result = GenerateNewKey(walletdb, internal); | ||||
return true; | return true; | ||||
} | } | ||||
KeepKey(nIndex); | KeepKey(nIndex); | ||||
result = keypool.vchPubKey; | result = keypool.vchPubKey; | ||||
} | |||||
return true; | return true; | ||||
} | } | ||||
static int64_t GetOldestKeyTimeInPool(const std::set<int64_t> &setKeyPool, | static int64_t GetOldestKeyTimeInPool(const std::set<int64_t> &setKeyPool, | ||||
CWalletDB &walletdb) { | CWalletDB &walletdb) { | ||||
if (setKeyPool.empty()) { | if (setKeyPool.empty()) { | ||||
return GetTime(); | return GetTime(); | ||||
} | } | ||||
▲ Show 20 Lines • Show All 859 Lines • Show Last 20 Lines |
This neither matches the backport PR nor provides any value by scoping the entire function. Leave this change out.