From d59531ddfc09f705c2ef3a33c41d6d910756da18 Mon Sep 17 00:00:00 2001 From: Jonas Schnelli Date: Mon, 16 Jan 2017 08:56:37 +0100 Subject: [PATCH] Immediately return setKeyPool's size if HD or HD_SPLIT is disabled or not supported --- src/wallet/wallet.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/wallet/wallet.cpp b/src/wallet/wallet.cpp index 71c97a4e8..349dff4f2 100644 --- a/src/wallet/wallet.cpp +++ b/src/wallet/wallet.cpp @@ -2912,6 +2912,10 @@ size_t CWallet::KeypoolCountExternalKeys() { AssertLockHeld(cs_wallet); // setKeyPool + // immediately return setKeyPool's size if HD or HD_SPLIT is disabled or not supported + if (!IsHDEnabled() || !CanSupportFeature(FEATURE_HD_SPLIT)) + return setKeyPool.size(); + CWalletDB walletdb(strWalletFile); // count amount of external keys