Fix locks in Capella setters (#11569)

Co-authored-by: prylabs-bulldozer[bot] <58059840+prylabs-bulldozer[bot]@users.noreply.github.com>
This commit is contained in:
Potuz 2022-10-22 20:10:45 -03:00 committed by GitHub
parent 968dc5d1e8
commit b7b5b28c5a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -64,8 +64,8 @@ func (b *BeaconState) SetNextWithdrawalIndex(i uint64) error {
return errNotSupported("SetNextWithdrawalIndex", b.version)
}
b.lock.RLock()
defer b.lock.RUnlock()
b.lock.Lock()
defer b.lock.Unlock()
b.nextWithdrawalIndex = i
return nil
@ -78,8 +78,8 @@ func (b *BeaconState) SetNextPartialWithdrawalValidatorIndex(i types.ValidatorIn
return errNotSupported("SetNextPartialWithdrawalValidatorIndex", b.version)
}
b.lock.RLock()
defer b.lock.RUnlock()
b.lock.Lock()
defer b.lock.Unlock()
b.nextPartialWithdrawalValidatorIndex = i
return nil