diff --git a/src/wallet/rpc/backup.cpp b/src/wallet/rpc/backup.cpp index 3ec4285a3f9..74f2b6dc7d6 100644 --- a/src/wallet/rpc/backup.cpp +++ b/src/wallet/rpc/backup.cpp @@ -611,8 +611,8 @@ RPCHelpMan restorewallet() return RPCHelpMan{ "restorewallet", "Restores and loads a wallet from backup.\n" - "\nThe rescan is significantly faster if a descriptor wallet is restored" - "\nand block filters are available (using startup option \"-blockfilterindex=1\").\n", + "\nThe rescan is significantly faster if block filters are available" + "\n(using startup option \"-blockfilterindex=1\").\n", { {"wallet_name", RPCArg::Type::STR, RPCArg::Optional::NO, "The name that will be applied to the restored wallet"}, {"backup_file", RPCArg::Type::STR, RPCArg::Optional::NO, "The backup file that will be used to restore the wallet."}, diff --git a/src/wallet/rpc/transactions.cpp b/src/wallet/rpc/transactions.cpp index fb40829d0b6..3580d2ceb06 100644 --- a/src/wallet/rpc/transactions.cpp +++ b/src/wallet/rpc/transactions.cpp @@ -857,8 +857,8 @@ RPCHelpMan rescanblockchain() "rescanblockchain", "Rescan the local blockchain for wallet related transactions.\n" "Note: Use \"getwalletinfo\" to query the scanning progress.\n" - "The rescan is significantly faster when used on a descriptor wallet\n" - "and block filters are available (using startup option \"-blockfilterindex=1\").\n", + "The rescan is significantly faster if block filters are available\n" + "(using startup option \"-blockfilterindex=1\").\n", { {"start_height", RPCArg::Type::NUM, RPCArg::Default{0}, "block height where the rescan should start"}, {"stop_height", RPCArg::Type::NUM, RPCArg::Optional::OMITTED, "the last block height that should be scanned. If none is provided it will rescan up to the tip at return time of this call."}, diff --git a/src/wallet/rpc/wallet.cpp b/src/wallet/rpc/wallet.cpp index c2db094fba5..b0bbfb0e265 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)) { @@ -356,8 +351,8 @@ static RPCHelpMan createwallet() RPCExamples{ HelpExampleCli("createwallet", "\"testwallet\"") + HelpExampleRpc("createwallet", "\"testwallet\"") - + HelpExampleCliNamed("createwallet", {{"wallet_name", "descriptors"}, {"avoid_reuse", true}, {"descriptors", true}, {"load_on_startup", true}}) - + HelpExampleRpcNamed("createwallet", {{"wallet_name", "descriptors"}, {"avoid_reuse", true}, {"descriptors", true}, {"load_on_startup", true}}) + + HelpExampleCliNamed("createwallet", {{"wallet_name", "descriptors"}, {"avoid_reuse", true}, {"load_on_startup", true}}) + + HelpExampleRpcNamed("createwallet", {{"wallet_name", "descriptors"}, {"avoid_reuse", true}, {"load_on_startup", true}}) }, [&](const RPCHelpMan& self, const JSONRPCRequest& request) -> UniValue { 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