Skip to content

Commit

Permalink
Missing defer before unlock (#5643)
Browse files Browse the repository at this point in the history
* missing defer before unlock
  • Loading branch information
imnisen committed Apr 27, 2020
1 parent eb5513f commit 7d74805
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion beacon-chain/state/getters.go
Expand Up @@ -451,7 +451,7 @@ func (b *BeaconState) ValidatorAtIndexReadOnly(idx uint64) (*ReadOnlyValidator,
// ValidatorIndexByPubkey returns a given validator by its 48-byte public key.
func (b *BeaconState) ValidatorIndexByPubkey(key [48]byte) (uint64, bool) {
b.lock.RLock()
b.lock.RUnlock()
defer b.lock.RUnlock()
idx, ok := b.valIdxMap[key]
return idx, ok
}
Expand Down

0 comments on commit 7d74805

Please sign in to comment.