mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-08-18 18:02:24 +00:00
core/state: rm panic and use log
This commit is contained in:
parent
330190e476
commit
caa7b86111
1 changed files with 8 additions and 9 deletions
|
|
@ -135,7 +135,8 @@ func (s *StateDB) DumpToCollector(c DumpCollector, conf *DumpConfig) (nextKey []
|
||||||
for it.Next() {
|
for it.Next() {
|
||||||
var data types.StateAccount
|
var data types.StateAccount
|
||||||
if err := rlp.DecodeBytes(it.Value, &data); err != nil {
|
if err := rlp.DecodeBytes(it.Value, &data); err != nil {
|
||||||
panic(err)
|
log.Error("Failed to decode", "err", err)
|
||||||
|
continue
|
||||||
}
|
}
|
||||||
var (
|
var (
|
||||||
account = DumpAccount{
|
account = DumpAccount{
|
||||||
|
|
@ -149,15 +150,13 @@ func (s *StateDB) DumpToCollector(c DumpCollector, conf *DumpConfig) (nextKey []
|
||||||
addr common.Address
|
addr common.Address
|
||||||
addrBytes = s.trie.GetKey(it.Key)
|
addrBytes = s.trie.GetKey(it.Key)
|
||||||
)
|
)
|
||||||
if addrBytes == nil {
|
if addrBytes != nil {
|
||||||
missingPreimages++
|
|
||||||
if conf.OnlyWithAddresses {
|
|
||||||
continue
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
addr = common.BytesToAddress(addrBytes)
|
addr = common.BytesToAddress(addrBytes)
|
||||||
address = &addr
|
account.Address = &addr
|
||||||
account.Address = address
|
} else if conf.OnlyWithAddresses {
|
||||||
|
continue
|
||||||
|
} else {
|
||||||
|
missingPreimages++
|
||||||
}
|
}
|
||||||
obj := newObject(s, addr, &data)
|
obj := newObject(s, addr, &data)
|
||||||
if !conf.SkipCode {
|
if !conf.SkipCode {
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue