From c25d90f125d69e33688288eff439eb7be75012e9 Mon Sep 17 00:00:00 2001 From: John Newbery Date: Thu, 3 Aug 2017 11:03:40 -0400 Subject: [wallet] Add HasUnusedKeys() helper --- src/wallet/wallet.cpp | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'src/wallet/wallet.cpp') diff --git a/src/wallet/wallet.cpp b/src/wallet/wallet.cpp index afe911ae9a..ce345804e1 100644 --- a/src/wallet/wallet.cpp +++ b/src/wallet/wallet.cpp @@ -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 &script) { std::shared_ptr rKey = std::make_shared(this); -- cgit v1.2.3