Remove redundant pre-TopUpKeypool checks

pull/16361/head
Gregory Sanders 5 years ago
parent 6c1e45c4c4
commit 96b6dd468a

@ -3414,8 +3414,7 @@ bool CWallet::TopUpKeyPool(unsigned int kpSize)
{
LOCK(cs_wallet);
if (IsLocked())
return false;
if (IsLocked()) return false;
// Top up key pool
unsigned int nTargetSize;
@ -3476,7 +3475,6 @@ bool CWallet::ReserveKeyFromKeyPool(int64_t& nIndex, CKeyPool& keypool, bool fRe
{
LOCK(cs_wallet);
if (!IsLocked())
TopUpKeyPool();
bool fReturningInternal = fRequestedInternal;
@ -3568,9 +3566,8 @@ bool CWallet::GetNewDestination(const OutputType type, const std::string label,
{
LOCK(cs_wallet);
error.clear();
if (!IsLocked()) {
TopUpKeyPool();
}
// Generate a new key that is added to wallet
CPubKey new_key;
@ -3588,9 +3585,8 @@ bool CWallet::GetNewDestination(const OutputType type, const std::string label,
bool CWallet::GetNewChangeDestination(const OutputType type, CTxDestination& dest, std::string& error)
{
error.clear();
if (!IsLocked()) {
TopUpKeyPool();
}
ReserveDestination reservedest(this);
if (!reservedest.GetReservedDestination(type, dest, true)) {

Loading…
Cancel
Save