diff options
author | Wenbiao Zheng <delweng@gmail.com> | 2018-05-29 23:48:43 +0800 |
---|---|---|
committer | Felix Lange <fjl@users.noreply.github.com> | 2018-05-29 23:48:43 +0800 |
commit | 38c7eb0f26eaa8df229d27e92f12e253313a6c8d (patch) | |
tree | 93b57c84013170b006b3cb47dd7b6341c387afcf /core | |
parent | d51faee2402072a6af66b8f08f6334944585419d (diff) | |
download | go-tangerine-38c7eb0f26eaa8df229d27e92f12e253313a6c8d.tar.gz go-tangerine-38c7eb0f26eaa8df229d27e92f12e253313a6c8d.tar.zst go-tangerine-38c7eb0f26eaa8df229d27e92f12e253313a6c8d.zip |
trie: rename TrieSync to Sync and improve hexToKeybytes (#16804)
This removes a golint warning: type name will be used as trie.TrieSync by
other packages, and that stutters; consider calling this Sync.
In hexToKeybytes len(hex) is even and (even+1)/2 == even/2, remove the +1.
Diffstat (limited to 'core')
-rw-r--r-- | core/state/sync.go | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/core/state/sync.go b/core/state/sync.go index 28fcf6ae0..c566e7907 100644 --- a/core/state/sync.go +++ b/core/state/sync.go @@ -25,8 +25,8 @@ import ( ) // NewStateSync create a new state trie download scheduler. -func NewStateSync(root common.Hash, database trie.DatabaseReader) *trie.TrieSync { - var syncer *trie.TrieSync +func NewStateSync(root common.Hash, database trie.DatabaseReader) *trie.Sync { + var syncer *trie.Sync callback := func(leaf []byte, parent common.Hash) error { var obj Account if err := rlp.Decode(bytes.NewReader(leaf), &obj); err != nil { @@ -36,6 +36,6 @@ func NewStateSync(root common.Hash, database trie.DatabaseReader) *trie.TrieSync syncer.AddRawEntry(common.BytesToHash(obj.CodeHash), 64, parent) return nil } - syncer = trie.NewTrieSync(root, database, callback) + syncer = trie.NewSync(root, database, callback) return syncer } |