[DLN] fixed missed_count for participation_rate calculateion on RNG, also hopefully fix missed block count for individual witnesses

This commit is contained in:
Viktor 2017-06-01 09:46:16 +03:00
parent af191e2929
commit 074817f29a

View file

@ -55,24 +55,25 @@ void database::update_global_dynamic_data( const signed_block& b )
#else #else
assert( missed_blocks != 0 ); assert( missed_blocks != 0 );
#endif #endif
if (gpo.parameters.witness_schedule_algorithm == GRAPHENE_WITNESS_SHUFFLED_ALGORITHM) // bad if-condition, this code needs to execute for both shuffled and rng algorithms
{ // if (gpo.parameters.witness_schedule_algorithm == GRAPHENE_WITNESS_SHUFFLED_ALGORITHM)
missed_blocks--; // {
for( uint32_t i = 0; i < missed_blocks; ++i ) { missed_blocks--;
const auto& witness_missed = get_scheduled_witness( i+1 )(*this); for( uint32_t i = 0; i < missed_blocks; ++i ) {
if( witness_missed.id != b.witness ) { const auto& witness_missed = get_scheduled_witness( i+1 )(*this);
/* if( witness_missed.id != b.witness ) {
const auto& witness_account = witness_missed.witness_account(*this); /*
if( (fc::time_point::now() - b.timestamp) < fc::seconds(30) ) const auto& witness_account = witness_missed.witness_account(*this);
wlog( "Witness ${name} missed block ${n} around ${t}", ("name",witness_account.name)("n",b.block_num())("t",b.timestamp) ); if( (fc::time_point::now() - b.timestamp) < fc::seconds(30) )
*/ wlog( "Witness ${name} missed block ${n} around ${t}", ("name",witness_account.name)("n",b.block_num())("t",b.timestamp) );
*/
modify( witness_missed, [&]( witness_object& w ) { modify( witness_missed, [&]( witness_object& w ) {
w.total_missed++; w.total_missed++;
}); });
} }
} }
} // }
#ifdef DIRTY_TRICK #ifdef DIRTY_TRICK
} }
#endif #endif