From 1e6e1d1fb40f548f934c5949f0401003d9feef90 Mon Sep 17 00:00:00 2001 From: Peter Bushnell Date: Fri, 20 Aug 2021 07:24:11 +0100 Subject: [PATCH] Make sure wallet is unlocked before dumping key --- src/spv/spv_rpc.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/spv/spv_rpc.cpp b/src/spv/spv_rpc.cpp index ab407f6419..90fd6bba93 100644 --- a/src/spv/spv_rpc.cpp +++ b/src/spv/spv_rpc.cpp @@ -1225,6 +1225,8 @@ static UniValue spv_dumpprivkey(const JSONRPCRequest& request) auto locked_chain = pwallet->chain().lock(); LOCK2(pwallet->cs_wallet, locked_chain->mutex()); + EnsureWalletIsUnlocked(pwallet); + std::string strAddress = request.params[0].get_str(); return spv::pspv->DumpBitcoinPrivKey(pwallet, strAddress);