wallet: Remove GetVersion()

This commit is contained in:
woltx
2025-07-14 21:15:45 -07:00
committed by w0xlt
parent 2e97541396
commit e27da3150b
2 changed files with 4 additions and 5 deletions

View File

@@ -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);

View File

@@ -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<Txid> GetConflicts(const Txid& txid) const EXCLUSIVE_LOCKS_REQUIRED(cs_wallet);