From 949a5ef9fe2a9fa9e490f62e72b38be6aebe535f Mon Sep 17 00:00:00 2001 From: Peter John Bushnell Date: Wed, 25 Aug 2021 22:58:18 +0100 Subject: [PATCH] Make sure wallet is unlocked before dumping key (#689) --- 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 ab407f64197..90fd6bba931 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);