aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorWladimir J. van der Laan <laanwj@gmail.com>2013-12-23 07:16:56 +0100
committerWladimir J. van der Laan <laanwj@gmail.com>2013-12-23 07:49:32 +0100
commitd78f35a909aac7c4456cee24bad2125205288d16 (patch)
treee2c8e3c061cdbc8630920a25526f7fff48466cb6
parentf46babc8c8271b1f25d35ae3c2f5257ae9159336 (diff)
Explicitly ensure that wallet is unlocked in `importprivkey`
This makes for a more useful error reply (fixes #957).
-rw-r--r--src/rpcdump.cpp2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/rpcdump.cpp b/src/rpcdump.cpp
index 92f4c2c6dd..c801b284cb 100644
--- a/src/rpcdump.cpp
+++ b/src/rpcdump.cpp
@@ -86,6 +86,8 @@ Value importprivkey(const Array& params, bool fHelp)
+ HelpExampleRpc("importprivkey", "\"mykey\", \"testing\", false")
);
+ EnsureWalletIsUnlocked();
+
string strSecret = params[0].get_str();
string strLabel = "";
if (params.size() > 1)