mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-06-29 18:20:58 +02:00
Explicitly ensure that wallet is unlocked in importprivkey
This makes for a more useful error reply (fixes #957).
This commit is contained in:
@ -86,6 +86,8 @@ Value importprivkey(const Array& params, bool fHelp)
|
|||||||
+ HelpExampleRpc("importprivkey", "\"mykey\", \"testing\", false")
|
+ HelpExampleRpc("importprivkey", "\"mykey\", \"testing\", false")
|
||||||
);
|
);
|
||||||
|
|
||||||
|
EnsureWalletIsUnlocked();
|
||||||
|
|
||||||
string strSecret = params[0].get_str();
|
string strSecret = params[0].get_str();
|
||||||
string strLabel = "";
|
string strLabel = "";
|
||||||
if (params.size() > 1)
|
if (params.size() > 1)
|
||||||
|
Reference in New Issue
Block a user