Skip to content

Commit

Permalink
wallet_rpc_server: longer timeout for stop_mining
Browse files Browse the repository at this point in the history
That RPC will wait for mining to actually stop, which can be a while
if randomx has just started on randomx_init_dataset.

This fixes occasional failures in the mining functional test
  • Loading branch information
moneromooo-monero committed Jul 21, 2022
1 parent ac6db92 commit 600de07
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/wallet/wallet_rpc_server.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3254,7 +3254,7 @@ namespace tools
if (!m_wallet) return not_open(er);
cryptonote::COMMAND_RPC_STOP_MINING::request daemon_req;
cryptonote::COMMAND_RPC_STOP_MINING::response daemon_res;
bool r = m_wallet->invoke_http_json("/stop_mining", daemon_req, daemon_res);
bool r = m_wallet->invoke_http_json("/stop_mining", daemon_req, daemon_res, std::chrono::seconds(60)); // this waits till stopped, and if randomx has just started initializing its dataset, it might be a while
if (!r || daemon_res.status != CORE_RPC_STATUS_OK)
{
er.code = WALLET_RPC_ERROR_CODE_UNKNOWN_ERROR;
Expand Down

0 comments on commit 600de07

Please sign in to comment.