Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions src/wallet/rpcwallet.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -380,15 +380,15 @@ UniValue upgradewallet(const JSONRPCRequest& request)
);

EnsureWallet();
EnsureWalletIsUnlocked();

LOCK2(cs_main, pwalletMain->cs_wallet);

// Do not do anything to non-HD wallets
if (pwalletMain->HasSaplingSPKM()) {
// Do not do anything to wallets already upgraded
if (pwalletMain->CanSupportFeature(FEATURE_LATEST)) {
throw JSONRPCError(RPC_WALLET_ERROR, "Cannot upgrade the wallet. The wallet is already running the latest version");
}

EnsureWalletIsUnlocked();

// Get version
int prev_version = pwalletMain->GetVersion();
// Upgrade wallet's version
Expand Down