mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-07-24 05:36:46 +00:00
fix: add with base
This commit is contained in:
parent
db070e667b
commit
9a3a6c72e2
1 changed files with 13 additions and 14 deletions
|
|
@ -83,21 +83,20 @@ type SizeStats struct {
|
||||||
|
|
||||||
// add applies the given state diffs and produces a new version of the statistics.
|
// add applies the given state diffs and produces a new version of the statistics.
|
||||||
func (s SizeStats) add(diff SizeStats) SizeStats {
|
func (s SizeStats) add(diff SizeStats) SizeStats {
|
||||||
var combo SizeStats
|
s.StateRoot = diff.StateRoot
|
||||||
combo.StateRoot = diff.StateRoot
|
s.BlockNumber = diff.BlockNumber
|
||||||
combo.BlockNumber = diff.BlockNumber
|
|
||||||
|
|
||||||
combo.Accounts += diff.Accounts
|
s.Accounts += diff.Accounts
|
||||||
combo.AccountBytes += diff.AccountBytes
|
s.AccountBytes += diff.AccountBytes
|
||||||
combo.Storages += diff.Storages
|
s.Storages += diff.Storages
|
||||||
combo.StorageBytes += diff.StorageBytes
|
s.StorageBytes += diff.StorageBytes
|
||||||
combo.AccountTrienodes += diff.AccountTrienodes
|
s.AccountTrienodes += diff.AccountTrienodes
|
||||||
combo.AccountTrienodeBytes += diff.AccountTrienodeBytes
|
s.AccountTrienodeBytes += diff.AccountTrienodeBytes
|
||||||
combo.StorageTrienodes += diff.StorageTrienodes
|
s.StorageTrienodes += diff.StorageTrienodes
|
||||||
combo.StorageTrienodeBytes += diff.StorageTrienodeBytes
|
s.StorageTrienodeBytes += diff.StorageTrienodeBytes
|
||||||
combo.ContractCodes += diff.ContractCodes
|
s.ContractCodes += diff.ContractCodes
|
||||||
combo.ContractCodeBytes += diff.ContractCodeBytes
|
s.ContractCodeBytes += diff.ContractCodeBytes
|
||||||
return combo
|
return s
|
||||||
}
|
}
|
||||||
|
|
||||||
// calSizeStats measures the state size changes of the provided state update.
|
// calSizeStats measures the state size changes of the provided state update.
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue