mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-07-17 18:30:45 +00:00
parent
906f07736e
commit
495a8b919a
2 changed files with 10 additions and 5 deletions
|
|
@ -201,9 +201,10 @@ func (s *stateObject) GetCommittedState(db Database, key common.Hash) common.Has
|
||||||
return value
|
return value
|
||||||
}
|
}
|
||||||
// Track the amount of time wasted on reading the storage trie
|
// Track the amount of time wasted on reading the storage trie
|
||||||
defer func(start time.Time) { s.db.StorageReads += time.Since(start) }(time.Now())
|
start := time.Now()
|
||||||
// Otherwise load the value from the database
|
// Otherwise load the value from the database
|
||||||
enc, err := s.getTrie(db).TryGet(key[:])
|
enc, err := s.getTrie(db).TryGet(key.Bytes())
|
||||||
|
s.db.StorageReads += time.Since(start)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
s.setError(err)
|
s.setError(err)
|
||||||
return common.Hash{}
|
return common.Hash{}
|
||||||
|
|
|
||||||
|
|
@ -526,10 +526,14 @@ func (s *StateDB) getDeletedStateObject(addr common.Address) *stateObject {
|
||||||
return obj
|
return obj
|
||||||
}
|
}
|
||||||
// Track the amount of time wasted on loading the object from the database
|
// Track the amount of time wasted on loading the object from the database
|
||||||
defer func(start time.Time) { s.AccountReads += time.Since(start) }(time.Now())
|
start := time.Now()
|
||||||
|
|
||||||
// Load the object from the database
|
// Load the object from the database
|
||||||
enc, err := s.trie.TryGet(addr[:])
|
enc, err := s.trie.TryGet(addr.Bytes())
|
||||||
|
s.AccountReads += time.Since(start)
|
||||||
|
if err != nil {
|
||||||
|
s.setError(fmt.Errorf("getDeleteStateObject (%x) error: %v", addr.Bytes(), err))
|
||||||
|
return nil
|
||||||
|
}
|
||||||
if len(enc) == 0 {
|
if len(enc) == 0 {
|
||||||
s.setError(err)
|
s.setError(err)
|
||||||
return nil
|
return nil
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue