mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-08-19 10:22:23 +00:00
core: avoid zero division
This commit is contained in:
parent
735c47ffc1
commit
2b5c735299
1 changed files with 6 additions and 3 deletions
|
|
@ -1957,9 +1957,12 @@ func (bc *BlockChain) processBlock(block *types.Block, statedb *state.StateDB, s
|
|||
|
||||
accountRead := statedb.SnapshotAccountReads + statedb.AccountReads // The time spent on account read
|
||||
storageRead := statedb.SnapshotStorageReads + statedb.StorageReads // The time spent on storage read
|
||||
if statedb.AccountLoaded != 0 {
|
||||
accountReadSingleTimer.Update(accountRead / time.Duration(statedb.AccountLoaded))
|
||||
}
|
||||
if statedb.StorageLoaded != 0 {
|
||||
storageReadSingleTimer.Update(storageRead / time.Duration(statedb.StorageLoaded))
|
||||
|
||||
}
|
||||
accountUpdateTimer.Update(statedb.AccountUpdates) // Account updates are complete(in validation)
|
||||
storageUpdateTimer.Update(statedb.StorageUpdates) // Storage updates are complete(in validation)
|
||||
accountHashTimer.Update(statedb.AccountHashes) // Account hashes are complete(in validation)
|
||||
|
|
|
|||
Loading…
Reference in a new issue