wallet/spkm: make GetOldestKeyPoolTime() const

The method checks the oldest key time for key pools and returns the oldest. It does no modifications.
This commit is contained in:
Karl-Johan Alm 2020-03-02 16:54:59 +09:00
parent 22d329ad0e
commit 227b9dd2d6
No known key found for this signature in database
GPG key ID: 57AF762DB3353322
4 changed files with 5 additions and 5 deletions

View file

@ -441,7 +441,7 @@ static int64_t GetOldestKeyTimeInPool(const std::set<int64_t>& setKeyPool, Walle
return keypool.nTime;
}
int64_t LegacyScriptPubKeyMan::GetOldestKeyPoolTime()
int64_t LegacyScriptPubKeyMan::GetOldestKeyPoolTime() const
{
LOCK(cs_KeyStore);

View file

@ -194,7 +194,7 @@ public:
//! The action to do when the DB needs rewrite
virtual void RewriteDB() {}
virtual int64_t GetOldestKeyPoolTime() { return GetTime(); }
virtual int64_t GetOldestKeyPoolTime() const { return GetTime(); }
virtual size_t KeypoolCountExternalKeys() const { return 0; }
virtual unsigned int GetKeyPoolSize() const { return 0; }
@ -336,7 +336,7 @@ public:
void RewriteDB() override;
int64_t GetOldestKeyPoolTime() override;
int64_t GetOldestKeyPoolTime() const override;
size_t KeypoolCountExternalKeys() const override;
unsigned int GetKeyPoolSize() const override;

View file

@ -3177,7 +3177,7 @@ bool CWallet::GetNewChangeDestination(const OutputType type, CTxDestination& des
return true;
}
int64_t CWallet::GetOldestKeyPoolTime()
int64_t CWallet::GetOldestKeyPoolTime() const
{
LOCK(cs_wallet);
int64_t oldestKey = std::numeric_limits<int64_t>::max();

View file

@ -971,7 +971,7 @@ public:
size_t KeypoolCountExternalKeys() const EXCLUSIVE_LOCKS_REQUIRED(cs_wallet);
bool TopUpKeyPool(unsigned int kpSize = 0);
int64_t GetOldestKeyPoolTime();
int64_t GetOldestKeyPoolTime() const;
std::set<std::set<CTxDestination>> GetAddressGroupings() EXCLUSIVE_LOCKS_REQUIRED(cs_wallet);
std::map<CTxDestination, CAmount> GetAddressBalances(interfaces::Chain::Lock& locked_chain);