aboutsummaryrefslogtreecommitdiffstats
path: root/core/state
diff options
context:
space:
mode:
authorobscuren <geffobscura@gmail.com>2015-03-24 22:14:03 +0800
committerobscuren <geffobscura@gmail.com>2015-03-24 22:14:03 +0800
commitbbe795455a13c57dbba64c1082b618e791af46ce (patch)
tree7eebc9ebb2f0365a7897e384fab4973122ebd2aa /core/state
parentd6da533345a397c3ea6c2bafe16e8c24765aa719 (diff)
downloaddexon-bbe795455a13c57dbba64c1082b618e791af46ce.tar
dexon-bbe795455a13c57dbba64c1082b618e791af46ce.tar.gz
dexon-bbe795455a13c57dbba64c1082b618e791af46ce.tar.bz2
dexon-bbe795455a13c57dbba64c1082b618e791af46ce.tar.lz
dexon-bbe795455a13c57dbba64c1082b618e791af46ce.tar.xz
dexon-bbe795455a13c57dbba64c1082b618e791af46ce.tar.zst
dexon-bbe795455a13c57dbba64c1082b618e791af46ce.zip
Secure trie shakey / key matching
Diffstat (limited to 'core/state')
-rw-r--r--core/state/dump.go8
1 files changed, 4 insertions, 4 deletions
diff --git a/core/state/dump.go b/core/state/dump.go
index 712f8da1f..70ea21691 100644
--- a/core/state/dump.go
+++ b/core/state/dump.go
@@ -28,17 +28,17 @@ func (self *StateDB) RawDump() World {
it := self.trie.Iterator()
for it.Next() {
- stateObject := NewStateObjectFromBytes(common.BytesToAddress(it.Key), it.Value, self.db)
+ addr := self.trie.GetKey(it.Key)
+ stateObject := NewStateObjectFromBytes(common.BytesToAddress(addr), it.Value, self.db)
account := Account{Balance: stateObject.balance.String(), Nonce: stateObject.nonce, Root: common.Bytes2Hex(stateObject.Root()), CodeHash: common.Bytes2Hex(stateObject.codeHash)}
account.Storage = make(map[string]string)
storageIt := stateObject.State.trie.Iterator()
for storageIt.Next() {
- fmt.Println("value", storageIt.Value)
- account.Storage[common.Bytes2Hex(storageIt.Key)] = common.Bytes2Hex(storageIt.Value)
+ account.Storage[common.Bytes2Hex(self.trie.GetKey(storageIt.Key))] = common.Bytes2Hex(storageIt.Value)
}
- world.Accounts[common.Bytes2Hex(it.Key)] = account
+ world.Accounts[common.Bytes2Hex(addr)] = account
}
return world
}