File tree Expand file tree Collapse file tree 2 files changed +8
-1
lines changed Expand file tree Collapse file tree 2 files changed +8
-1
lines changed Original file line number Diff line number Diff line change @@ -3611,6 +3611,11 @@ void CReserveKey::ReturnKey()
36113611 vchPubKey = CPubKey ();
36123612}
36133613
3614+ bool CWallet::HasUnusedKeys (int min_keys) const
3615+ {
3616+ return setExternalKeyPool.size () >= min_keys && (setInternalKeyPool.size () >= min_keys || !CanSupportFeature (FEATURE_HD_SPLIT));
3617+ }
3618+
36143619void CWallet::GetScriptForMining (std::shared_ptr<CReserveScript> &script)
36153620{
36163621 std::shared_ptr<CReserveKey> rKey = std::make_shared<CReserveKey>(this );
Original file line number Diff line number Diff line change @@ -813,7 +813,7 @@ class CWallet : public CCryptoKeyStore, public CValidationInterface
813813 const CWalletTx* GetWalletTx (const uint256& hash) const ;
814814
815815 // ! check whether we are allowed to upgrade (or already support) to the named feature
816- bool CanSupportFeature (enum WalletFeature wf) { AssertLockHeld (cs_wallet); return nWalletMaxVersion >= wf; }
816+ bool CanSupportFeature (enum WalletFeature wf) const { AssertLockHeld (cs_wallet); return nWalletMaxVersion >= wf; }
817817
818818 /* *
819819 * populate vCoins with vector of available COutputs.
@@ -978,6 +978,8 @@ class CWallet : public CCryptoKeyStore, public CValidationInterface
978978 bool GetKeyFromPool (CPubKey &key, bool internal = false );
979979 int64_t GetOldestKeyPoolTime ();
980980 const std::map<CKeyID, int64_t >& GetAllReserveKeys () const { return m_pool_key_to_index; }
981+ /* * Does the wallet have at least min_keys in the keypool? */
982+ bool HasUnusedKeys (int min_keys) const ;
981983
982984 std::set< std::set<CTxDestination> > GetAddressGroupings ();
983985 std::map<CTxDestination, CAmount> GetAddressBalances ();
You can’t perform that action at this time.
0 commit comments