aboutsummaryrefslogtreecommitdiff
path: root/src/wallet/wallet.cpp
diff options
context:
space:
mode:
authorJohn Newbery <john@johnnewbery.com>2017-08-03 11:03:40 -0400
committerJohn Newbery <john@johnnewbery.com>2017-08-04 16:42:53 -0400
commitc25d90f125d69e33688288eff439eb7be75012e9 (patch)
tree12c42085eb6bfbe772c787e37427accb01e8edac /src/wallet/wallet.cpp
parentf2123e3a7bf30545967b9ceb37961976cf7d64fb (diff)
downloadbitcoin-c25d90f125d69e33688288eff439eb7be75012e9.tar.xz
[wallet] Add HasUnusedKeys() helper
Diffstat (limited to 'src/wallet/wallet.cpp')
-rw-r--r--src/wallet/wallet.cpp5
1 files changed, 5 insertions, 0 deletions
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<CReserveScript> &script)
{
std::shared_ptr<CReserveKey> rKey = std::make_shared<CReserveKey>(this);