From b7b5b28c5a92a303fab5cdf10a81bc9e564dc4db Mon Sep 17 00:00:00 2001 From: Potuz Date: Sat, 22 Oct 2022 20:10:45 -0300 Subject: [PATCH] Fix locks in Capella setters (#11569) Co-authored-by: prylabs-bulldozer[bot] <58059840+prylabs-bulldozer[bot]@users.noreply.github.com> --- beacon-chain/state/state-native/setters_withdrawal.go | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/beacon-chain/state/state-native/setters_withdrawal.go b/beacon-chain/state/state-native/setters_withdrawal.go index d5f8b629e..7ec1dc0fd 100644 --- a/beacon-chain/state/state-native/setters_withdrawal.go +++ b/beacon-chain/state/state-native/setters_withdrawal.go @@ -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