aboutsummaryrefslogtreecommitdiff
path: root/src/cryptonote_core/cryptonote_core.cpp
diff options
context:
space:
mode:
authorRiccardo Spagni <ric@spagni.net>2017-12-16 23:27:00 +0200
committerRiccardo Spagni <ric@spagni.net>2017-12-16 23:27:00 +0200
commit8da24c2a57fdb9a04137537f3e339e1876407d8d (patch)
treefb45239aebb9b13d52d3e13862f1c9dc636217a2 /src/cryptonote_core/cryptonote_core.cpp
parentec63d64a6799894a5eeb075acf6f2267f387aa61 (diff)
parentabebe392c7bb9fb0ff716c9640cd752e579ba068 (diff)
downloadmonzero-core-8da24c2a57fdb9a04137537f3e339e1876407d8d.tar.gz
monzero-core-8da24c2a57fdb9a04137537f3e339e1876407d8d.tar.xz
monzero-core-8da24c2a57fdb9a04137537f3e339e1876407d8d.zip
Merge pull request #2878
abebe392 rpc: add offline state in info rpc (moneromooo-monero) 7696e849 core: make --offline also disable DNS lookups (moneromooo-monero)
Diffstat (limited to 'src/cryptonote_core/cryptonote_core.cpp')
-rw-r--r--src/cryptonote_core/cryptonote_core.cpp16
1 files changed, 15 insertions, 1 deletions
diff --git a/src/cryptonote_core/cryptonote_core.cpp b/src/cryptonote_core/cryptonote_core.cpp
index 6c772a2ab..04f1e46a7 100644
--- a/src/cryptonote_core/cryptonote_core.cpp
+++ b/src/cryptonote_core/cryptonote_core.cpp
@@ -75,6 +75,10 @@ namespace cryptonote
, "Run on testnet. The wallet must be launched with --testnet flag."
, false
};
+ const command_line::arg_descriptor<bool> arg_offline = {
+ "offline"
+ , "Do not listen for peers, nor connect to any"
+ };
static const command_line::arg_descriptor<bool> arg_test_drop_download = {
"test-drop-download"
@@ -227,6 +231,7 @@ namespace cryptonote
command_line::add_arg(desc, arg_check_updates);
command_line::add_arg(desc, arg_fluffy_blocks);
command_line::add_arg(desc, arg_test_dbg_lock_sleep);
+ command_line::add_arg(desc, arg_offline);
// we now also need some of net_node's options (p2p bind arg, for separate data dir)
command_line::add_arg(desc, nodetool::arg_testnet_p2p_bind_port, false);
@@ -264,6 +269,7 @@ namespace cryptonote
set_enforce_dns_checkpoints(command_line::get_arg(vm, arg_dns_checkpoints));
test_drop_download_height(command_line::get_arg(vm, arg_test_drop_download_height));
m_fluffy_blocks_enabled = m_testnet || get_arg(vm, arg_fluffy_blocks);
+ m_offline = get_arg(vm, arg_offline);
if (command_line::get_arg(vm, arg_test_drop_download) == true)
test_drop_download();
@@ -1340,8 +1346,13 @@ namespace cryptonote
{
if(!m_starter_message_showed)
{
+ std::string main_message;
+ if (m_offline)
+ main_message = "The daemon is running offline and will not attempt to sync to the Monero network.";
+ else
+ main_message = "The daemon will start synchronizing with the network. This may take a long time to complete.";
MGINFO_YELLOW(ENDL << "**********************************************************************" << ENDL
- << "The daemon will start synchronizing with the network. This may take a long time to complete." << ENDL
+ << main_message << ENDL
<< ENDL
<< "You can set the level of process detailization through \"set_log <level|categories>\" command," << ENDL
<< "where <level> is between 0 (no details) and 4 (very verbose), or custom category based levels (eg, *:WARNING)." << ENDL
@@ -1404,6 +1415,9 @@ namespace cryptonote
static const char subdir[] = "source"; // because it can never be simple
#endif
+ if (m_offline)
+ return true;
+
if (check_updates_level == UPDATES_DISABLED)
return true;