@@ -27,29 +27,29 @@ import (
2727)
2828
2929// NewStateSync create a new state trie download scheduler.
30- func NewStateSync (root common.Hash , database ethdb.KeyValueReader , onLeaf func (paths [][]byte , leaf []byte ) error ) * trie.Sync {
30+ func NewStateSync (root common.Hash , database ethdb.KeyValueReader , onLeaf func (keys [][]byte , leaf []byte ) error ) * trie.Sync {
3131 // Register the storage slot callback if the external callback is specified.
32- var onSlot func (paths [][]byte , hexpath []byte , leaf []byte , parent common.Hash ) error
32+ var onSlot func (keys [][]byte , path []byte , leaf []byte , parent common.Hash , parentPath [] byte ) error
3333 if onLeaf != nil {
34- onSlot = func (paths [][]byte , hexpath []byte , leaf []byte , parent common.Hash ) error {
35- return onLeaf (paths , leaf )
34+ onSlot = func (keys [][]byte , path []byte , leaf []byte , parent common.Hash , parentPath [] byte ) error {
35+ return onLeaf (keys , leaf )
3636 }
3737 }
3838 // Register the account callback to connect the state trie and the storage
3939 // trie belongs to the contract.
4040 var syncer * trie.Sync
41- onAccount := func (paths [][]byte , hexpath []byte , leaf []byte , parent common.Hash ) error {
41+ onAccount := func (keys [][]byte , path []byte , leaf []byte , parent common.Hash , parentPath [] byte ) error {
4242 if onLeaf != nil {
43- if err := onLeaf (paths , leaf ); err != nil {
43+ if err := onLeaf (keys , leaf ); err != nil {
4444 return err
4545 }
4646 }
4747 var obj types.StateAccount
4848 if err := rlp .Decode (bytes .NewReader (leaf ), & obj ); err != nil {
4949 return err
5050 }
51- syncer .AddSubTrie (obj .Root , hexpath , parent , onSlot )
52- syncer .AddCodeEntry (common .BytesToHash (obj .CodeHash ), hexpath , parent )
51+ syncer .AddSubTrie (obj .Root , path , parent , parentPath , onSlot )
52+ syncer .AddCodeEntry (common .BytesToHash (obj .CodeHash ), path , parent , parentPath )
5353 return nil
5454 }
5555 syncer = trie .NewSync (root , database , onAccount )
0 commit comments