Immediately return setKeyPool's size if HD or HD_SPLIT is disabled or not supported

This commit is contained in:
Jonas Schnelli 2017-01-16 08:56:37 +01:00
parent 02592f4c5e
commit d59531ddfc
No known key found for this signature in database
GPG key ID: 1EB776BB03C7922D

View file

@ -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