#341 Added option --dry-run.

This commit is contained in:
XMRig 2018-01-20 20:43:31 +07:00
parent 56ffa7af79
commit 631fd755c8
4 changed files with 34 additions and 9 deletions

View file

@ -130,6 +130,13 @@ int App::exec()
Mem::allocate(m_options->algo(), m_options->threads(), m_options->doubleHash(), m_options->hugePages());
Summary::print();
if (m_options->dryRun()) {
LOG_NOTICE("OK");
release();
return 0;
}
# ifndef XMRIG_NO_API
Api::start();
# endif
@ -146,12 +153,7 @@ int App::exec()
const int r = uv_run(uv_default_loop(), UV_RUN_DEFAULT);
uv_loop_close(uv_default_loop());
delete m_network;
Options::release();
Mem::release();
Platform::release();
release();
return r;
}
@ -200,6 +202,18 @@ void App::close()
}
void App::release()
{
if (m_network) {
delete m_network;
}
Options::release();
Mem::release();
Platform::release();
}
void App::onSignal(uv_signal_t *handle, int signum)
{
switch (signum)