diff options
author | Gregory Sanders <gsanders87@gmail.com> | 2019-07-09 10:09:56 -0400 |
---|---|---|
committer | Gregory Sanders <gsanders87@gmail.com> | 2019-07-10 09:39:26 -0400 |
commit | 96b6dd468a4cb6077d1a2267d620d99d39aac7d0 (patch) | |
tree | e4f11358a8c71f4c84e37484515f7b7806e4a05d | |
parent | 6c1e45c4c41676f80ac6fb8d48cfbcf839593f19 (diff) |
Remove redundant pre-TopUpKeypool checks
-rw-r--r-- | src/wallet/wallet.cpp | 16 |
1 files changed, 6 insertions, 10 deletions
diff --git a/src/wallet/wallet.cpp b/src/wallet/wallet.cpp index a9bd1e3164..5fb883d48b 100644 --- a/src/wallet/wallet.cpp +++ b/src/wallet/wallet.cpp @@ -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,8 +3475,7 @@ bool CWallet::ReserveKeyFromKeyPool(int64_t& nIndex, CKeyPool& keypool, bool fRe { LOCK(cs_wallet); - if (!IsLocked()) - TopUpKeyPool(); + TopUpKeyPool(); bool fReturningInternal = fRequestedInternal; fReturningInternal &= (IsHDEnabled() && CanSupportFeature(FEATURE_HD_SPLIT)) || IsWalletFlagSet(WALLET_FLAG_DISABLE_PRIVATE_KEYS); @@ -3568,9 +3566,8 @@ bool CWallet::GetNewDestination(const OutputType type, const std::string label, { LOCK(cs_wallet); error.clear(); - if (!IsLocked()) { - TopUpKeyPool(); - } + + 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(); - } + + TopUpKeyPool(); ReserveDestination reservedest(this); if (!reservedest.GetReservedDestination(type, dest, true)) { |