Skip to content

Commit d78f35a

Browse files
committed
Explicitly ensure that wallet is unlocked in importprivkey
This makes for a more useful error reply (fixes #957).
1 parent f46babc commit d78f35a

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

src/rpcdump.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -86,6 +86,8 @@ Value importprivkey(const Array& params, bool fHelp)
8686
+ HelpExampleRpc("importprivkey", "\"mykey\", \"testing\", false")
8787
);
8888

89+
EnsureWalletIsUnlocked();
90+
8991
string strSecret = params[0].get_str();
9092
string strLabel = "";
9193
if (params.size() > 1)

0 commit comments

Comments
 (0)