Make sure ReserveKeyFromKeyPool only hands out internal keys if HD_SPLIT is supported

This commit is contained in:
Jonas Schnelli 2017-01-16 09:05:27 +01:00
parent 05a9b493eb
commit 469a47b760
No known key found for this signature in database
GPG Key ID: 1EB776BB03C7922D
1 changed files with 1 additions and 1 deletions

View File

@ -3001,7 +3001,7 @@ void CWallet::ReserveKeyFromKeyPool(int64_t& nIndex, CKeyPool& keypool, bool int
throw std::runtime_error(std::string(__func__) + ": read failed");
if (!HaveKey(tmpKeypool.vchPubKey.GetID()))
throw std::runtime_error(std::string(__func__) + ": unknown key in key pool");
if (!IsHDEnabled() || tmpKeypool.fInternal == internal)
if (!IsHDEnabled() || (tmpKeypool.fInternal == internal && CanSupportFeature(FEATURE_HD_SPLIT)))
{
nIndex = id;
keypool = tmpKeypool;