Skip to content

Commit

Permalink
Merge pull request #6718 from multiversx/fix_deadlock
Browse files Browse the repository at this point in the history
fix missing runlock
  • Loading branch information
AdoAdoAdo authored Jan 20, 2025
2 parents 2a1a875 + daef2cf commit 72bcd3f
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions process/block/baseProcess.go
Original file line number Diff line number Diff line change
Expand Up @@ -635,6 +635,7 @@ func (bp *baseProcessor) sortHeadersForCurrentBlockByNonce(usedInBlock bool) (ma
}

if bp.hasMissingProof(headerInfo, hdrHash) {
bp.hdrsForCurrBlock.mutHdrsForBlock.RUnlock()
return nil, fmt.Errorf("%w for header with hash %s", process.ErrMissingHeaderProof, hex.EncodeToString([]byte(hdrHash)))
}

Expand All @@ -660,6 +661,7 @@ func (bp *baseProcessor) sortHeaderHashesForCurrentBlockByNonce(usedInBlock bool
}

if bp.hasMissingProof(headerInfo, metaBlockHash) {
bp.hdrsForCurrBlock.mutHdrsForBlock.RUnlock()
return nil, fmt.Errorf("%w for header with hash %s", process.ErrMissingHeaderProof, hex.EncodeToString([]byte(metaBlockHash)))
}

Expand Down

0 comments on commit 72bcd3f

Please sign in to comment.