Skip to content

Commit 037fa77

Browse files
committed
wallet: make KeypoolCountExternalKeys() const
This method returns the sum of the key pool sizes. It does no modification.
1 parent ddc9355 commit 037fa77

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
@@ -459,7 +459,7 @@ int64_t LegacyScriptPubKeyMan::GetOldestKeyPoolTime()
459459
return oldestKey;
460460
}
461461

462-
size_t LegacyScriptPubKeyMan::KeypoolCountExternalKeys()
462+
size_t LegacyScriptPubKeyMan::KeypoolCountExternalKeys() const
463463
{
464464
LOCK(cs_KeyStore);
465465
return setExternalKeyPool.size() + set_pre_split_keypool.size();

src/wallet/scriptpubkeyman.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -196,7 +196,7 @@ class ScriptPubKeyMan
196196

197197
virtual int64_t GetOldestKeyPoolTime() { return GetTime(); }
198198

199-
virtual size_t KeypoolCountExternalKeys() { return 0; }
199+
virtual size_t KeypoolCountExternalKeys() const { return 0; }
200200
virtual unsigned int GetKeyPoolSize() const { return 0; }
201201

202202
virtual int64_t GetTimeFirstKey() const { return 0; }
@@ -337,7 +337,7 @@ class LegacyScriptPubKeyMan : public ScriptPubKeyMan, public FillableSigningProv
337337
void RewriteDB() override;
338338

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

343343
int64_t GetTimeFirstKey() const override;

src/wallet/wallet.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3112,7 +3112,7 @@ bool CWallet::DelAddressBook(const CTxDestination& address)
31123112
return WalletBatch(*database).EraseName(EncodeDestination(address));
31133113
}
31143114

3115-
size_t CWallet::KeypoolCountExternalKeys()
3115+
size_t CWallet::KeypoolCountExternalKeys() const
31163116
{
31173117
AssertLockHeld(cs_wallet);
31183118

src/wallet/wallet.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -968,7 +968,7 @@ class CWallet final : public WalletStorage, private interfaces::Chain::Notificat
968968
/** Absolute maximum transaction fee (in satoshis) used by default for the wallet */
969969
CAmount m_default_max_tx_fee{DEFAULT_TRANSACTION_MAXFEE};
970970

971-
size_t KeypoolCountExternalKeys() EXCLUSIVE_LOCKS_REQUIRED(cs_wallet);
971+
size_t KeypoolCountExternalKeys() const EXCLUSIVE_LOCKS_REQUIRED(cs_wallet);
972972
bool TopUpKeyPool(unsigned int kpSize = 0);
973973

974974
int64_t GetOldestKeyPoolTime();

0 commit comments

Comments
 (0)