From 79df9df3482d71391dee1dd59054aed8f7bbfa6b Mon Sep 17 00:00:00 2001 From: Jonas Schnelli Date: Tue, 17 Jan 2017 08:55:30 +0100 Subject: Switch to 100% for the HD internal keypool size --- src/wallet/wallet.cpp | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) (limited to 'src/wallet/wallet.cpp') diff --git a/src/wallet/wallet.cpp b/src/wallet/wallet.cpp index e7ac918b2..7ad48e37b 100644 --- a/src/wallet/wallet.cpp +++ b/src/wallet/wallet.cpp @@ -2946,13 +2946,11 @@ bool CWallet::TopUpKeyPool(unsigned int kpSize) nTargetSize = std::max(GetArg("-keypool", DEFAULT_KEYPOOL_SIZE), (int64_t) 0); // count amount of available keys (internal, external) - // make sure the keypool of external keys fits the user selected target (-keypool) - // generate +20% internal keys (minimum 2 keys) + // make sure the keypool of external and internal keys fits the user selected target (-keypool) int64_t amountExternal = KeypoolCountExternalKeys(); int64_t amountInternal = setKeyPool.size() - amountExternal; - int64_t targetInternal = std::max((int64_t)ceil(nTargetSize * 0.2), (int64_t) 2); int64_t missingExternal = std::max(std::max((int64_t) nTargetSize, (int64_t) 1) - amountExternal, (int64_t) 0); - int64_t missingInternal = std::max(targetInternal - amountInternal, (int64_t) 0); + int64_t missingInternal = std::max(std::max((int64_t) nTargetSize, (int64_t) 1) - amountInternal, (int64_t) 0); if (!IsHDEnabled() || !CanSupportFeature(FEATURE_HD_SPLIT)) { -- cgit v1.2.3