Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 6 additions & 3 deletions src/rpc/evo.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1372,14 +1372,14 @@ static UniValue protx_list(const JSONRPCRequest& request, CDeterministicMNManage
throw std::runtime_error("\"protx list wallet\" not supported when wallet is disabled");
}
#ifdef ENABLE_WALLET
LOCK2(wallet->cs_wallet, cs_main);

if (request.params.size() > 4) {
protx_list_help(request);
}

bool detailed = !request.params[1].isNull() ? ParseBoolV(request.params[1], "detailed") : false;

LOCK2(wallet->cs_wallet, cs_main);
int height = !request.params[2].isNull() ? ParseInt32V(request.params[2], "height") : chainman.ActiveChain().Height();
if (height < 1 || height > chainman.ActiveChain().Height()) {
throw JSONRPCError(RPC_INVALID_PARAMETER, "invalid height specified");
Expand Down Expand Up @@ -1408,10 +1408,13 @@ static UniValue protx_list(const JSONRPCRequest& request, CDeterministicMNManage
protx_list_help(request);
}

LOCK(cs_main);

bool detailed = !request.params[1].isNull() ? ParseBoolV(request.params[1], "detailed") : false;

#ifdef ENABLE_WALLET
LOCK2(wallet ? wallet->cs_wallet : cs_main, cs_main);
Comment thread
UdjinM6 marked this conversation as resolved.
#else
LOCK(cs_main);
#endif
int height = !request.params[2].isNull() ? ParseInt32V(request.params[2], "height") : chainman.ActiveChain().Height();
if (height < 1 || height > chainman.ActiveChain().Height()) {
throw JSONRPCError(RPC_INVALID_PARAMETER, "invalid height specified");
Expand Down