diff --git a/src/wallet/rpc/wallet.cpp b/src/wallet/rpc/wallet.cpp index 01413f02229..d68118994bf 100644 --- a/src/wallet/rpc/wallet.cpp +++ b/src/wallet/rpc/wallet.cpp @@ -40,7 +40,7 @@ static RPCHelpMan getwalletinfo() { { {RPCResult::Type::STR, "walletname", "the wallet name"}, - {RPCResult::Type::NUM, "walletversion", "the wallet version"}, + {RPCResult::Type::NUM, "walletversion", "(DEPRECATED) only related to unsupported legacy wallet, returns the latest version 169900 for backwards compatibility"}, {RPCResult::Type::STR, "format", "the database format (only sqlite)"}, {RPCResult::Type::NUM, "txcount", "the total number of transactions in the wallet"}, {RPCResult::Type::NUM, "keypoolsize", "how many new keys are pre-generated (only counts external keys)"}, @@ -82,9 +82,11 @@ static RPCHelpMan getwalletinfo() UniValue obj(UniValue::VOBJ); + const int latest_legacy_wallet_minversion{169900}; + size_t kpExternalSize = pwallet->KeypoolCountExternalKeys(); obj.pushKV("walletname", pwallet->GetName()); - obj.pushKV("walletversion", pwallet->GetVersion()); + obj.pushKV("walletversion", latest_legacy_wallet_minversion); obj.pushKV("format", pwallet->GetDatabase().Format()); obj.pushKV("txcount", (int)pwallet->mapWallet.size()); obj.pushKV("keypoolsize", (int64_t)kpExternalSize); diff --git a/src/wallet/wallet.h b/src/wallet/wallet.h index 95ed7af806a..1b1080fd81c 100644 --- a/src/wallet/wallet.h +++ b/src/wallet/wallet.h @@ -828,9 +828,6 @@ public: //! signify that a particular wallet feature is now used. void SetMinVersion(enum WalletFeature, WalletBatch* batch_in = nullptr) override; - //! get the current wallet format (the oldest client version guaranteed to understand this wallet) - int GetVersion() const { LOCK(cs_wallet); return nWalletVersion; } - //! Get wallet transactions that conflict with given transaction (spend same outputs) std::set GetConflicts(const Txid& txid) const EXCLUSIVE_LOCKS_REQUIRED(cs_wallet);