[wallet] Add HasUnusedKeys() helper

This commit is contained in:
John Newbery
2017-08-03 11:03:40 -04:00
parent f2123e3a7b
commit c25d90f125
2 changed files with 8 additions and 1 deletions

View File

@@ -3611,6 +3611,11 @@ void CReserveKey::ReturnKey()
vchPubKey = CPubKey();
}
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<CReserveScript> &script)
{
std::shared_ptr<CReserveKey> rKey = std::make_shared<CReserveKey>(this);