From 1221f60c94971c0f66abe5fdf086087a173bb0ac Mon Sep 17 00:00:00 2001 From: John Newbery Date: Mon, 14 Aug 2017 13:36:25 -0400 Subject: [PATCH 1/2] [wallet] Remove keypool_topup_cleanups Unused function. Mostly reverts c25d90f125d69e33688288eff439eb7be75012e9 c25d90f... was merged as part of PR 11022 but is not required. --- src/wallet/wallet.cpp | 5 ----- src/wallet/wallet.h | 2 -- 2 files changed, 7 deletions(-) diff --git a/src/wallet/wallet.cpp b/src/wallet/wallet.cpp index 599e74149..aa0713ea0 100644 --- a/src/wallet/wallet.cpp +++ b/src/wallet/wallet.cpp @@ -3663,11 +3663,6 @@ void CWallet::MarkReserveKeysAsUsed(int64_t keypool_id) } } -bool CWallet::HasUnusedKeys(int min_keys) const -{ - return setExternalKeyPool.size() >= min_keys && (setInternalKeyPool.size() >= min_keys || !CanSupportFeature(FEATURE_HD_SPLIT)); -} - void CWallet::GetScriptForMining(std::shared_ptr &script) { std::shared_ptr rKey = std::make_shared(this); diff --git a/src/wallet/wallet.h b/src/wallet/wallet.h index f97a99d82..296bb7321 100644 --- a/src/wallet/wallet.h +++ b/src/wallet/wallet.h @@ -984,8 +984,6 @@ public: */ void MarkReserveKeysAsUsed(int64_t keypool_id); const std::map& GetAllReserveKeys() const { return m_pool_key_to_index; } - /** Does the wallet have at least min_keys in the keypool? */ - bool HasUnusedKeys(int min_keys) const; std::set< std::set > GetAddressGroupings(); std::map GetAddressBalances(); From 67ceff4039ae038ae16f06128f868a2e8395b59a Mon Sep 17 00:00:00 2001 From: John Newbery Date: Mon, 14 Aug 2017 13:38:21 -0400 Subject: [PATCH 2/2] [wallet] Add logging to MarkReserveKeysAsUsed --- src/wallet/wallet.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/src/wallet/wallet.cpp b/src/wallet/wallet.cpp index aa0713ea0..680c5ed9b 100644 --- a/src/wallet/wallet.cpp +++ b/src/wallet/wallet.cpp @@ -3659,6 +3659,7 @@ void CWallet::MarkReserveKeysAsUsed(int64_t keypool_id) m_pool_key_to_index.erase(keypool.vchPubKey.GetID()); } walletdb.ErasePool(index); + LogPrintf("keypool index %d removed\n", index); it = setKeyPool->erase(it); } }