mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-07-24 13:46:43 +00:00
fix(statesize): use hash length
Signed-off-by: jsvisa <delweng@gmail.com>
This commit is contained in:
parent
b8d6e5e203
commit
3480095c43
2 changed files with 3 additions and 3 deletions
|
|
@ -254,11 +254,11 @@ func (sc *StateUpdate) IntoChangeset() *StateChangeset {
|
||||||
}
|
}
|
||||||
if len(newValue) == 0 {
|
if len(newValue) == 0 {
|
||||||
storages -= 1
|
storages -= 1
|
||||||
storageSize -= common.HashLength
|
storageSize -= 2 * common.HashLength
|
||||||
}
|
}
|
||||||
if len(oldValue) == 0 {
|
if len(oldValue) == 0 {
|
||||||
storages += 1
|
storages += 1
|
||||||
storageSize += common.HashLength
|
storageSize += 2 * common.HashLength
|
||||||
}
|
}
|
||||||
storageSize += len(newValue) - len(oldValue)
|
storageSize += len(newValue) - len(oldValue)
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -77,7 +77,7 @@ func (s *stateTracer) onGenesisBlock(b *types.Block, alloc types.GenesisAlloc) {
|
||||||
)
|
)
|
||||||
for _, account := range alloc {
|
for _, account := range alloc {
|
||||||
accounts++
|
accounts++
|
||||||
accountSize += common.AddressLength
|
accountSize += common.HashLength
|
||||||
storages += len(account.Storage)
|
storages += len(account.Storage)
|
||||||
storageSize += len(account.Storage) * 2 * common.HashLength
|
storageSize += len(account.Storage) * 2 * common.HashLength
|
||||||
if len(account.Code) > 0 {
|
if len(account.Code) > 0 {
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue