Commit f721901d authored by David Vorick's avatar David Vorick

resolve race condition in sanity check

parent b294eb49
Pipeline #47426691 failed with stages
in 22 minutes and 4 seconds
......@@ -176,6 +176,7 @@ func (sfs *SiaFileSet) open(siaPath string) (*SiaFileSetEntry, error) {
// Sanity check - as we open the file, check that the pubKeyTable is
// consistent with the lookups in the pieces.
if build.DEBUG {
entry.mu.Lock()
for _, chunk := range entry.staticChunks {
for _, pieceSet := range chunk.Pieces {
for _, piece := range pieceSet {
......@@ -185,6 +186,7 @@ func (sfs *SiaFileSet) open(siaPath string) (*SiaFileSetEntry, error) {
}
}
}
entry.mu.Unlock()
}
threadUID := randomThreadUID()
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment