Skip to content

Commit

Permalink
re-correct lock usage
Browse files Browse the repository at this point in the history
  • Loading branch information
mh0lt committed May 28, 2024
1 parent b83f5a2 commit cc08895
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 7 deletions.
3 changes: 1 addition & 2 deletions polygon/bor/finality/whitelist/milestone.go
Original file line number Diff line number Diff line change
Expand Up @@ -216,8 +216,7 @@ func (m *milestone) GetMilestoneIDsList() []string {
func (m *milestone) purgeMilestoneIDsList() {
// try is used here as the finality lock is preserved over calls - so the lock state
// is not clearly defined in the local code - this likely needs to be revised
if !m.finality.TryLock() {
m.finality.Lock()
if m.finality.TryLock() {
defer m.finality.Unlock()
}

Expand Down
6 changes: 1 addition & 5 deletions polygon/bor/finality/whitelist/service_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -548,11 +548,7 @@ func TestPropertyBasedTestingMilestone(t *testing.T) {
}

fitlerFn := func(i uint64) bool {
if i <= uint64(1000) {
return true
}

return false
return i <= uint64(1000)
}

var (
Expand Down

0 comments on commit cc08895

Please sign in to comment.