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()
3611
3611
vchPubKey = CPubKey ();
3612
3612
}
3613
3613
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
+
3614
3619
void CWallet::GetScriptForMining (std::shared_ptr<CReserveScript> &script)
3615
3620
{
3616
3621
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
813
813
const CWalletTx* GetWalletTx (const uint256& hash) const ;
814
814
815
815
// ! 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; }
817
817
818
818
/* *
819
819
* populate vCoins with vector of available COutputs.
@@ -978,6 +978,8 @@ class CWallet : public CCryptoKeyStore, public CValidationInterface
978
978
bool GetKeyFromPool (CPubKey &key, bool internal = false );
979
979
int64_t GetOldestKeyPoolTime ();
980
980
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 ;
981
983
982
984
std::set< std::set<CTxDestination> > GetAddressGroupings ();
983
985
std::map<CTxDestination, CAmount> GetAddressBalances ();
You can’t perform that action at this time.
0 commit comments