core/state: fix state iterator

This commit is contained in:
rjl493456442 2019-02-19 18:37:22 +08:00
parent 2a0e1bb32b
commit 671a305801

View file

@ -486,7 +486,14 @@ func (db *StateDB) ForEachStorage(addr common.Address, cb func(key, value common
cb(key, value) cb(key, value)
continue continue
} }
cb(key, common.BytesToHash(it.Value))
if len(it.Value) > 0 {
_, content, _, err := rlp.Split(it.Value)
if err != nil {
continue
}
cb(key, common.BytesToHash(content))
}
} }
} }