Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixed forgotten mutexes Unlock calls #5761

Merged
merged 1 commit into from
Dec 12, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
4 changes: 3 additions & 1 deletion process/block/metablock.go
Original file line number Diff line number Diff line change
Expand Up @@ -1094,6 +1094,7 @@
false)

if createErr != nil {
mp.hdrsForCurrBlock.mutHdrsForBlock.Unlock()

Check warning on line 1097 in process/block/metablock.go

View check run for this annotation

Codecov / codecov/patch

process/block/metablock.go#L1097

Added line #L1097 was not covered by tests
return nil, 0, 0, createErr
}

Expand Down Expand Up @@ -1999,6 +2000,8 @@
}

mp.hdrsForCurrBlock.mutHdrsForBlock.Lock()
defer mp.hdrsForCurrBlock.mutHdrsForBlock.Unlock()

for hdrHash, headerInfo := range mp.hdrsForCurrBlock.hdrHashAndInfo {
if !headerInfo.usedInBlock {
continue
Expand Down Expand Up @@ -2048,7 +2051,6 @@

shardInfo = append(shardInfo, &shardData)
}
mp.hdrsForCurrBlock.mutHdrsForBlock.Unlock()

log.Debug("created shard data",
"size", len(shardInfo),
Expand Down
1 change: 1 addition & 0 deletions process/block/shardblock.go
Original file line number Diff line number Diff line change
Expand Up @@ -1906,6 +1906,7 @@

shouldContinue, errCreated := sp.createMbsAndProcessCrossShardTransactionsDstMe(createAndProcessInfo)
if errCreated != nil {
sp.hdrsForCurrBlock.mutHdrsForBlock.Unlock()

Check warning on line 1909 in process/block/shardblock.go

View check run for this annotation

Codecov / codecov/patch

process/block/shardblock.go#L1909

Added line #L1909 was not covered by tests
return nil, errCreated
}
if !shouldContinue {
Expand Down