aboutsummaryrefslogtreecommitdiff
path: root/src/daemon
diff options
context:
space:
mode:
authorRiccardo Spagni <ric@spagni.net>2014-10-02 16:48:01 +0200
committerRiccardo Spagni <ric@spagni.net>2014-10-02 16:48:05 +0200
commit1cf22b27a6b95e1e44c35157f5c5ccb73efec9da (patch)
tree770a470c84cd8c7c7ef816dd2c34078d5aebbc7a /src/daemon
parentsimplewallet ignoring testnet port in RPC mode (diff)
parentDaemon should now exit on conflicting checkpoints (diff)
downloadmonero-1cf22b27a6b95e1e44c35157f5c5ccb73efec9da.tar.xz
Merge pull request #165
c0bdd51 Daemon should now exit on conflicting checkpoints (Thomas Winget) f0b4138 various changes to runtime checkpoint updating (Thomas Winget) 7568f89 Fixed segfault with checkpoints loading (Thomas Winget) b261d92 DNS checkpoint updating added, and daemon flag to enforce them (Thomas Winget) 30caebf reload checkpoints file every ~hr and print if any fail (Thomas Winget) 0e14491 updated DNSResolver/things that use it for DNSSEC (Thomas Winget) 6f2c2e1 Adding an identical existing checkpoint should not error (Thomas Winget)
Diffstat (limited to 'src/daemon')
-rw-r--r--src/daemon/daemon.cpp9
1 files changed, 7 insertions, 2 deletions
diff --git a/src/daemon/daemon.cpp b/src/daemon/daemon.cpp
index 5c209482e..da09acfd4 100644
--- a/src/daemon/daemon.cpp
+++ b/src/daemon/daemon.cpp
@@ -69,6 +69,7 @@ namespace
, "Run on testnet. The wallet must be launched with --testnet flag."
, false
};
+ const command_line::arg_descriptor<bool> arg_dns_checkpoints = {"enforce-dns-checkpointing", "checkpoints from DNS server will be enforced", false};
}
bool command_line_preprocessor(const boost::program_options::variables_map& vm)
@@ -135,6 +136,7 @@ int main(int argc, char* argv[])
command_line::add_arg(desc_cmd_sett, arg_log_level);
command_line::add_arg(desc_cmd_sett, arg_console);
command_line::add_arg(desc_cmd_sett, arg_testnet_on);
+ command_line::add_arg(desc_cmd_sett, arg_dns_checkpoints);
cryptonote::core::init_options(desc_cmd_sett);
cryptonote::core_rpc_server::init_options(desc_cmd_sett);
@@ -206,16 +208,19 @@ int main(int argc, char* argv[])
CHECK_AND_ASSERT_MES(res, 1, "Failed to initialize checkpoints");
boost::filesystem::path json(JSON_HASH_FILE_NAME);
boost::filesystem::path checkpoint_json_hashfile_fullpath = data_dir / json;
- res = cryptonote::load_checkpoins_from_json(checkpoints, checkpoint_json_hashfile_fullpath.string().c_str());
- CHECK_AND_ASSERT_MES(res, 1, "Failed to load initial checkpoints");
//create objects and link them
cryptonote::core ccore(NULL);
+ // tell core if we're enforcing dns checkpoints
+ bool enforce_dns = command_line::get_arg(vm, arg_dns_checkpoints);
+ ccore.set_enforce_dns_checkpoints(enforce_dns);
+
if (testnet_mode) {
LOG_PRINT_L0("Starting in testnet mode!");
} else {
ccore.set_checkpoints(std::move(checkpoints));
+ ccore.set_checkpoints_file_path(checkpoint_json_hashfile_fullpath.string());
}
cryptonote::t_cryptonote_protocol_handler<cryptonote::core> cprotocol(ccore, NULL);