Skip to content

Commit

Permalink
Merge pull request #3 from marten-seemann/fix-threshold-off-by-one-error
Browse files Browse the repository at this point in the history
fix off-by-one error in the threshold
  • Loading branch information
Stebalien authored Jan 26, 2018
2 parents 15e5327 + be4a5f4 commit 0212611
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion p2p/net/upgrader/threshold.go
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ func (t *threshold) Release() {
// Wait waits for the counter to drop below the threshold
func (t *threshold) Wait() {
t.mu.Lock()
for t.count > t.threshold {
for t.count >= t.threshold {
t.cond.Wait()
}
t.mu.Unlock()
Expand Down

0 comments on commit 0212611

Please sign in to comment.