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