diff options
author | gary rong <garyrong0905@gmail.com> | 2019-08-12 22:14:40 +0800 |
---|---|---|
committer | Péter Szilágyi <peterke@gmail.com> | 2019-08-12 22:14:40 +0800 |
commit | df6c08a485270f96f8a65124748246b84b2c37ae (patch) | |
tree | a64702be9f2240fff844c51e7a03ffd78c996765 /core/state | |
parent | 8657a0d6b5777ae5a94cb4714ae18b0c38a25c09 (diff) | |
download | go-tangerine-df6c08a485270f96f8a65124748246b84b2c37ae.tar go-tangerine-df6c08a485270f96f8a65124748246b84b2c37ae.tar.gz go-tangerine-df6c08a485270f96f8a65124748246b84b2c37ae.tar.bz2 go-tangerine-df6c08a485270f96f8a65124748246b84b2c37ae.tar.lz go-tangerine-df6c08a485270f96f8a65124748246b84b2c37ae.tar.xz go-tangerine-df6c08a485270f96f8a65124748246b84b2c37ae.tar.zst go-tangerine-df6c08a485270f96f8a65124748246b84b2c37ae.zip |
core, trie: decode the value for storage dump (#19943)
* core, trie: decode the value for storage dump
* core/state: address comment
Diffstat (limited to 'core/state')
-rw-r--r-- | core/state/dump.go | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/core/state/dump.go b/core/state/dump.go index 51d3e5554..7912fd5f9 100644 --- a/core/state/dump.go +++ b/core/state/dump.go @@ -118,7 +118,12 @@ func (self *StateDB) dump(c collector, excludeCode, excludeStorage, excludeMissi account.Storage = make(map[common.Hash]string) storageIt := trie.NewIterator(obj.getTrie(self.db).NodeIterator(nil)) for storageIt.Next() { - account.Storage[common.BytesToHash(self.trie.GetKey(storageIt.Key))] = common.Bytes2Hex(storageIt.Value) + _, content, _, err := rlp.Split(storageIt.Value) + if err != nil { + log.Error("Failed to decode the value returned by iterator", "error", err) + continue + } + account.Storage[common.BytesToHash(self.trie.GetKey(storageIt.Key))] = common.Bytes2Hex(content) } } c.onAccount(addr, account) |