Skip to content

Commit

Permalink
Fixing ExtendTimerByFactor
Browse files Browse the repository at this point in the history
This was already from milliseconds, thus, just removing the multiplier
  • Loading branch information
vncoelho authored Jul 22, 2019
1 parent a4badf0 commit dc6bd12
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion neo/Consensus/ConsensusService.cs
Original file line number Diff line number Diff line change
Expand Up @@ -232,7 +232,7 @@ private void OnCommitReceived(ConsensusPayload payload, Commit commit)
// this function increases existing timer (never decreases) with a value proportional to `maxDelayInBlockTimes`*`Blockchain.MillisecondsPerBlock`
private void ExtendTimerByFactor(int maxDelayInBlockTimes)
{
TimeSpan nextDelay = expected_delay - (TimeProvider.Current.UtcNow - clock_started) + TimeSpan.FromMilliseconds(maxDelayInBlockTimes * Blockchain.MillisecondsPerBlock * 1000.0 / context.M);
TimeSpan nextDelay = expected_delay - (TimeProvider.Current.UtcNow - clock_started) + TimeSpan.FromMilliseconds(maxDelayInBlockTimes * Blockchain.MillisecondsPerBlock / context.M);
if (!context.WatchOnly && !context.ViewChanging && !context.CommitSent && (nextDelay > TimeSpan.Zero))
ChangeTimer(nextDelay);
}
Expand Down

0 comments on commit dc6bd12

Please sign in to comment.