diff --git a/libraries/chain/db_update.cpp b/libraries/chain/db_update.cpp index e4f8ab86..8c7a00ae 100644 --- a/libraries/chain/db_update.cpp +++ b/libraries/chain/db_update.cpp @@ -42,7 +42,9 @@ void database::update_global_dynamic_data( const signed_block& b ) // dynamic global properties updating modify( _dgp, [&]( dynamic_global_property_object& dgp ){ - if( _checkpoints.size() && _checkpoints.rbegin()->first >= b.block_num() ) + if( BOOST_UNLIKELY( b.block_num() == 1 ) ) + dgp.recently_missed_count = 0; + else if( _checkpoints.size() && _checkpoints.rbegin()->first >= b.block_num() ) dgp.recently_missed_count = 0; else if( missed_blocks ) dgp.recently_missed_count += GRAPHENE_RECENTLY_MISSED_COUNT_INCREMENT*missed_blocks; diff --git a/libraries/plugins/witness/witness.cpp b/libraries/plugins/witness/witness.cpp index 9290837d..3b646f97 100644 --- a/libraries/plugins/witness/witness.cpp +++ b/libraries/plugins/witness/witness.cpp @@ -26,12 +26,35 @@ #include #include +#include + using namespace graphene::witness_plugin; using std::string; using std::vector; namespace bpo = boost::program_options; +void new_chain_banner( const graphene::chain::database& db ) +{ + std::cerr << "\n" + "********************************\n" + "* *\n" + "* ------- NEW CHAIN ------ *\n" + "* - Welcome to Graphene! - *\n" + "* ------------------------ *\n" + "* *\n" + "********************************\n" + "\n"; + if( db.get_slot_at_time( graphene::time::now() ) > 200 ) + { + std::cerr << "Your genesis seems to have an old timestamp\n" + "Please consider using a script to produce a genesis file with a recent timestamp\n" + "\n" + ; + } + return; +} + void witness_plugin::plugin_set_program_options( boost::program_options::options_description& command_line_options, boost::program_options::options_description& config_file_options) @@ -138,6 +161,8 @@ void witness_plugin::plugin_startup() { ilog("Launching block production for ${n} witnesses.", ("n", _witnesses.size())); app().set_block_production(true); + if( _production_enabled && (d.head_block_num() == 0) ) + new_chain_banner(d); schedule_next_production(d.get_global_properties().parameters); } else elog("No witnesses configured! Please add witness IDs and private keys to configuration.");