Skip to content

Commit 227b9dd

Browse files
committed
wallet/spkm: make GetOldestKeyPoolTime() const
The method checks the oldest key time for key pools and returns the oldest. It does no modifications.
1 parent 22d329a commit 227b9dd

File tree

4 files changed

+5
-5
lines changed

4 files changed

+5
-5
lines changed

src/wallet/scriptpubkeyman.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -441,7 +441,7 @@ static int64_t GetOldestKeyTimeInPool(const std::set<int64_t>& setKeyPool, Walle
441441
return keypool.nTime;
442442
}
443443

444-
int64_t LegacyScriptPubKeyMan::GetOldestKeyPoolTime()
444+
int64_t LegacyScriptPubKeyMan::GetOldestKeyPoolTime() const
445445
{
446446
LOCK(cs_KeyStore);
447447

src/wallet/scriptpubkeyman.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -194,7 +194,7 @@ class ScriptPubKeyMan
194194
//! The action to do when the DB needs rewrite
195195
virtual void RewriteDB() {}
196196

197-
virtual int64_t GetOldestKeyPoolTime() { return GetTime(); }
197+
virtual int64_t GetOldestKeyPoolTime() const { return GetTime(); }
198198

199199
virtual size_t KeypoolCountExternalKeys() const { return 0; }
200200
virtual unsigned int GetKeyPoolSize() const { return 0; }
@@ -336,7 +336,7 @@ class LegacyScriptPubKeyMan : public ScriptPubKeyMan, public FillableSigningProv
336336

337337
void RewriteDB() override;
338338

339-
int64_t GetOldestKeyPoolTime() override;
339+
int64_t GetOldestKeyPoolTime() const override;
340340
size_t KeypoolCountExternalKeys() const override;
341341
unsigned int GetKeyPoolSize() const override;
342342

src/wallet/wallet.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3177,7 +3177,7 @@ bool CWallet::GetNewChangeDestination(const OutputType type, CTxDestination& des
31773177
return true;
31783178
}
31793179

3180-
int64_t CWallet::GetOldestKeyPoolTime()
3180+
int64_t CWallet::GetOldestKeyPoolTime() const
31813181
{
31823182
LOCK(cs_wallet);
31833183
int64_t oldestKey = std::numeric_limits<int64_t>::max();

src/wallet/wallet.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -971,7 +971,7 @@ class CWallet final : public WalletStorage, private interfaces::Chain::Notificat
971971
size_t KeypoolCountExternalKeys() const EXCLUSIVE_LOCKS_REQUIRED(cs_wallet);
972972
bool TopUpKeyPool(unsigned int kpSize = 0);
973973

974-
int64_t GetOldestKeyPoolTime();
974+
int64_t GetOldestKeyPoolTime() const;
975975

976976
std::set<std::set<CTxDestination>> GetAddressGroupings() EXCLUSIVE_LOCKS_REQUIRED(cs_wallet);
977977
std::map<CTxDestination, CAmount> GetAddressBalances(interfaces::Chain::Lock& locked_chain);

0 commit comments

Comments
 (0)