diff --git a/libraries/app/application.cpp b/libraries/app/application.cpp index b5288b4c..ce0d0818 100644 --- a/libraries/app/application.cpp +++ b/libraries/app/application.cpp @@ -197,6 +197,20 @@ namespace detail { if( _options->count("resync-blockchain") ) _chain_db->wipe(_data_dir / "blockchain", true); + if( _options->count("checkpoint") ) + { + auto cps = _options->at("checkpoint").as>(); + flat_map loaded_checkpoints; + loaded_checkpoints.reserve( cps.size() ); + for( auto cp : cps ) + { + auto item = fc::json::from_string(cp).as >(); + loaded_checkpoints[item.first] = item.second; + } + _chain_db->add_checkpoints( loaded_checkpoints ); + } + + if( _options->count("replay-blockchain") ) { ilog("Replaying blockchain on user request."); @@ -483,12 +497,13 @@ void application::set_program_options(boost::program_options::options_descriptio configuration_file_options.add_options() ("p2p-endpoint", bpo::value(), "Endpoint for P2P node to listen on") ("seed-node,s", bpo::value>()->composing(), "P2P nodes to connect to on startup (may specify multiple times)") + ("checkpoint,c", bpo::value>()->composing(), "Pairs of [BLOCK_NUM,BLOCK_ID] that should be enforced as checkpoints.") ("rpc-endpoint", bpo::value()->implicit_value("127.0.0.1:8090"), "Endpoint for websocket RPC to listen on") ("rpc-tls-endpoint", bpo::value()->implicit_value("127.0.0.1:8089"), "Endpoint for TLS websocket RPC to listen on") ("server-pem,p", bpo::value()->implicit_value("server.pem"), "The TLS certificate file for this server") ("server-pem-password,P", bpo::value()->implicit_value(""), "Password for this certificate") ("genesis-json", bpo::value(), "File to read Genesis State from") - ("apiaccess", bpo::value(), "JSON file specifying API permissions") + ("api-access", bpo::value(), "JSON file specifying API permissions") ; command_line_options.add(configuration_file_options); command_line_options.add_options() diff --git a/libraries/fc b/libraries/fc index 8d13f292..2ef7583f 160000 --- a/libraries/fc +++ b/libraries/fc @@ -1 +1 @@ -Subproject commit 8d13f292b8ad47d4055bba8721731d73acd0561f +Subproject commit 2ef7583f90b8593511dda23133ed5600f5add392