Skip to content

Commit

Permalink
Merge pull request #590 from iotaledger/fix/liveness-threshold-datarace
Browse files Browse the repository at this point in the history
Add lock to resolve potential data race.
  • Loading branch information
piotrm50 authored Dec 4, 2023
2 parents 137a186 + 6a97929 commit 73bcaa9
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions pkg/protocol/engine/tipselection/v1/tip_selection.go
Original file line number Diff line number Diff line change
Expand Up @@ -187,6 +187,9 @@ func (t *TipSelection) classifyTip(tipMetadata tipmanager.TipMetadata) {
tipMetadata.TipPool().Set(tipmanager.DroppedTipPool)
}

t.livenessThresholdQueueMutex.RLock()
defer t.livenessThresholdQueueMutex.RUnlock()

t.livenessThresholdQueue.Push(tipMetadata, tipMetadata.Block().IssuingTime().Add(t.livenessThreshold(tipMetadata)))
}

Expand Down

0 comments on commit 73bcaa9

Please sign in to comment.