This commit is contained in:
rkapka
2020-10-08 13:36:43 +02:00
parent 6035543455
commit c64a153f67
2 changed files with 4 additions and 4 deletions

View File

@@ -255,12 +255,12 @@ func (b *BeaconState) FieldReferencesCount() map[string]uint64 {
b.lock.RLock()
defer b.lock.RUnlock()
for i, f := range b.sharedFieldReferences {
refMap[i.String()] = uint64(f.Refs())
refMap[i.String()] = f.Refs()
}
for i, f := range b.stateFieldLeaves {
f.lock.RLock()
if len(f.fieldLayers) != 0 {
refMap[i.String()+"_trie"] = uint64(f.Refs())
refMap[i.String()+"_trie"] = f.Refs()
}
f.lock.RUnlock()
}

View File

@@ -74,7 +74,7 @@ var fieldMap map[fieldIndex]dataType
// releases their reference to the field value, they must decrement the refs. Likewise whenever a
// copy is performed then the state must increment the refs counter.
type reference struct {
refs uint
refs uint64
lock sync.RWMutex
}
@@ -152,7 +152,7 @@ type ReadOnlyValidator struct {
validator *ethpb.Validator
}
func (r *reference) Refs() uint {
func (r *reference) Refs() uint64 {
r.lock.RLock()
defer r.lock.RUnlock()
return r.refs