mirror of
https://github.com/Retropex/bitcoin.git
synced 2025-05-20 07:00:44 +02:00
rpc: Avoid locking cs_main in some wallet RPC
This commit is contained in:
parent
1b04b55f2d
commit
00f58f8c48
@ -562,7 +562,6 @@ static UniValue decoderawtransaction(const JSONRPCRequest& request)
|
|||||||
+ HelpExampleRpc("decoderawtransaction", "\"hexstring\"")
|
+ HelpExampleRpc("decoderawtransaction", "\"hexstring\"")
|
||||||
);
|
);
|
||||||
|
|
||||||
LOCK(cs_main);
|
|
||||||
RPCTypeCheck(request.params, {UniValue::VSTR, UniValue::VBOOL});
|
RPCTypeCheck(request.params, {UniValue::VSTR, UniValue::VBOOL});
|
||||||
|
|
||||||
CMutableTransaction mtx;
|
CMutableTransaction mtx;
|
||||||
|
@ -165,7 +165,7 @@ static UniValue getnewaddress(const JSONRPCRequest& request)
|
|||||||
throw JSONRPCError(RPC_WALLET_ERROR, "Error: Private keys are disabled for this wallet");
|
throw JSONRPCError(RPC_WALLET_ERROR, "Error: Private keys are disabled for this wallet");
|
||||||
}
|
}
|
||||||
|
|
||||||
LOCK2(cs_main, pwallet->cs_wallet);
|
LOCK(pwallet->cs_wallet);
|
||||||
|
|
||||||
// Parse the label first so we don't generate a key if there's an error
|
// Parse the label first so we don't generate a key if there's an error
|
||||||
std::string label;
|
std::string label;
|
||||||
@ -276,7 +276,7 @@ static UniValue getrawchangeaddress(const JSONRPCRequest& request)
|
|||||||
throw JSONRPCError(RPC_WALLET_ERROR, "Error: Private keys are disabled for this wallet");
|
throw JSONRPCError(RPC_WALLET_ERROR, "Error: Private keys are disabled for this wallet");
|
||||||
}
|
}
|
||||||
|
|
||||||
LOCK2(cs_main, pwallet->cs_wallet);
|
LOCK(pwallet->cs_wallet);
|
||||||
|
|
||||||
if (!pwallet->IsLocked()) {
|
if (!pwallet->IsLocked()) {
|
||||||
pwallet->TopUpKeyPool();
|
pwallet->TopUpKeyPool();
|
||||||
@ -331,7 +331,7 @@ static UniValue setlabel(const JSONRPCRequest& request)
|
|||||||
+ HelpExampleRpc("setlabel", "\"1D1ZrZNe3JUo7ZycKEYQQiQAWd9y54F4XX\", \"tabby\"")
|
+ HelpExampleRpc("setlabel", "\"1D1ZrZNe3JUo7ZycKEYQQiQAWd9y54F4XX\", \"tabby\"")
|
||||||
);
|
);
|
||||||
|
|
||||||
LOCK2(cs_main, pwallet->cs_wallet);
|
LOCK(pwallet->cs_wallet);
|
||||||
|
|
||||||
CTxDestination dest = DecodeDestination(request.params[0].get_str());
|
CTxDestination dest = DecodeDestination(request.params[0].get_str());
|
||||||
if (!IsValidDestination(dest)) {
|
if (!IsValidDestination(dest)) {
|
||||||
|
Loading…
Reference in New Issue
Block a user