diff --git a/src/wallet/rpc/wallet.cpp b/src/wallet/rpc/wallet.cpp index c2db094fba5..d6859b8043a 100644 --- a/src/wallet/rpc/wallet.cpp +++ b/src/wallet/rpc/wallet.cpp @@ -46,7 +46,6 @@ static RPCHelpMan getwalletinfo() {RPCResult::Type::STR_AMOUNT, "unconfirmed_balance", "DEPRECATED. Identical to getbalances().mine.untrusted_pending"}, {RPCResult::Type::STR_AMOUNT, "immature_balance", "DEPRECATED. Identical to getbalances().mine.immature"}, {RPCResult::Type::NUM, "txcount", "the total number of transactions in the wallet"}, - {RPCResult::Type::NUM_TIME, "keypoololdest", /*optional=*/true, "the " + UNIX_EPOCH_TIME + " of the oldest pre-generated key in the key pool. Legacy wallets only."}, {RPCResult::Type::NUM, "keypoolsize", "how many new keys are pre-generated (only counts external keys)"}, {RPCResult::Type::NUM, "keypoolsize_hd_internal", /*optional=*/true, "how many new keys are pre-generated for internal use (used for change outputs, only appears if the wallet is using this feature, otherwise external keys are used)"}, {RPCResult::Type::NUM_TIME, "unlocked_until", /*optional=*/true, "the " + UNIX_EPOCH_TIME + " until which the wallet is unlocked for transfers, or 0 if the wallet is locked (only present for passphrase-encrypted wallets)"}, @@ -91,10 +90,6 @@ static RPCHelpMan getwalletinfo() obj.pushKV("unconfirmed_balance", ValueFromAmount(bal.m_mine_untrusted_pending)); obj.pushKV("immature_balance", ValueFromAmount(bal.m_mine_immature)); obj.pushKV("txcount", (int)pwallet->mapWallet.size()); - const auto kp_oldest = pwallet->GetOldestKeyPoolTime(); - if (kp_oldest.has_value()) { - obj.pushKV("keypoololdest", kp_oldest.value()); - } obj.pushKV("keypoolsize", (int64_t)kpExternalSize); if (pwallet->CanSupportFeature(FEATURE_HD_SPLIT)) { diff --git a/src/wallet/scriptpubkeyman.cpp b/src/wallet/scriptpubkeyman.cpp index 29cf4e9a2ca..d2ac171f8d3 100644 --- a/src/wallet/scriptpubkeyman.cpp +++ b/src/wallet/scriptpubkeyman.cpp @@ -1189,13 +1189,6 @@ bool DescriptorScriptPubKeyMan::HaveCryptedKeys() const return !m_map_crypted_keys.empty(); } -std::optional DescriptorScriptPubKeyMan::GetOldestKeyPoolTime() const -{ - // This is only used for getwalletinfo output and isn't relevant to descriptor wallets. - return std::nullopt; -} - - unsigned int DescriptorScriptPubKeyMan::GetKeyPoolSize() const { LOCK(cs_desc_man); diff --git a/src/wallet/scriptpubkeyman.h b/src/wallet/scriptpubkeyman.h index 13b8233879c..e41ab6d669d 100644 --- a/src/wallet/scriptpubkeyman.h +++ b/src/wallet/scriptpubkeyman.h @@ -133,8 +133,6 @@ public: //! The action to do when the DB needs rewrite virtual void RewriteDB() {} - virtual std::optional GetOldestKeyPoolTime() const { return GetTime(); } - virtual unsigned int GetKeyPoolSize() const { return 0; } virtual int64_t GetTimeFirstKey() const { return 0; } @@ -364,7 +362,6 @@ public: std::optional GetKey(const CKeyID& keyid) const EXCLUSIVE_LOCKS_REQUIRED(cs_desc_man); bool HaveCryptedKeys() const override; - std::optional GetOldestKeyPoolTime() const override; unsigned int GetKeyPoolSize() const override; int64_t GetTimeFirstKey() const override; diff --git a/src/wallet/wallet.cpp b/src/wallet/wallet.cpp index 4a4aa837eaa..6542abc23df 100644 --- a/src/wallet/wallet.cpp +++ b/src/wallet/wallet.cpp @@ -2506,20 +2506,6 @@ util::Result CWallet::GetNewChangeDestination(const OutputType t return op_dest; } -std::optional CWallet::GetOldestKeyPoolTime() const -{ - LOCK(cs_wallet); - if (m_spk_managers.empty()) { - return std::nullopt; - } - - std::optional oldest_key{std::numeric_limits::max()}; - for (const auto& spk_man_pair : m_spk_managers) { - oldest_key = std::min(oldest_key, spk_man_pair.second->GetOldestKeyPoolTime()); - } - return oldest_key; -} - void CWallet::MarkDestinationsDirty(const std::set& destinations) { for (auto& entry : mapWallet) { CWalletTx& wtx = entry.second; diff --git a/src/wallet/wallet.h b/src/wallet/wallet.h index fbc3bed2ab6..0c4f89ccf5c 100644 --- a/src/wallet/wallet.h +++ b/src/wallet/wallet.h @@ -733,8 +733,6 @@ public: size_t KeypoolCountExternalKeys() const EXCLUSIVE_LOCKS_REQUIRED(cs_wallet); bool TopUpKeyPool(unsigned int kpSize = 0); - std::optional GetOldestKeyPoolTime() const; - // Filter struct for 'ListAddrBookAddresses' struct AddrBookFilter { // Fetch addresses with the provided label