diff --git a/src/consensus.cpp b/src/consensus.cpp index 4efb7ee2..a299dde9 100644 --- a/src/consensus.cpp +++ b/src/consensus.cpp @@ -1077,7 +1077,8 @@ namespace consensus // Check whether we have received enough votes in total. // Threshold is devided by 100 to convert average to decimal. - const uint32_t min_votes_required = ceil((conf::cfg.contract.consensus.threshold / 100.0) * unl_count); + const float stage_threshold = ((STAGE_THRESHOLD_RATIO[ctx.stage - 1] * conf::cfg.contract.consensus.threshold) / (STAGE_THRESHOLD_RATIO[2] * 100.0)); + const uint32_t min_votes_required = ceil(stage_threshold * unl_count); if (total_ledger_primary_hash_votes < min_votes_required) { LOG_INFO << "Not enough peers proposing to perform consensus. votes:" << total_ledger_primary_hash_votes << " needed:" << min_votes_required; @@ -1474,7 +1475,7 @@ namespace consensus // We allocate configured stage slice for stages 1, 2, 3. Stage 0 gets the entire remaining time from the round window. ctx.stage123_duration = conf::cfg.contract.consensus.roundtime * conf::cfg.contract.consensus.stage_slice / 100; ctx.stage0_duration = conf::cfg.contract.consensus.roundtime - (ctx.stage123_duration * 3); - ctx.stage_reset_wait_threshold = conf::cfg.contract.consensus.roundtime / 10; + ctx.stage_reset_wait_threshold = conf::cfg.contract.consensus.roundtime / 15; // We use a time window boundry offset based on contract id to vary the window boundries between // different contracts with same round time.