Skip to content

Commit 08a049b

Browse files
committed
fix mpt loading
1 parent b006ae5 commit 08a049b

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

cmd/migration-checker/main.go

+3-3
Original file line numberDiff line numberDiff line change
@@ -186,7 +186,7 @@ func loadMPT(mptTrie *trie.SecureTrie, top bool) chan []kv {
186186
if !top {
187187
workers = 1 << 3
188188
}
189-
step := byte(0xFF) / byte(workers)
189+
step := byte(256 / workers)
190190

191191
mptLeafs := make([]kv, 0, 1000)
192192
var mptLeafMutex sync.Mutex
@@ -196,12 +196,12 @@ func loadMPT(mptTrie *trie.SecureTrie, top bool) chan []kv {
196196
startKey[0] = byte(i) * step
197197
trieIt := trie.NewIterator(mptTrie.NodeIterator(startKey))
198198

199-
stopKey := byte(i+1) * step
199+
stopKey := (i + 1) * int(step)
200200
mptWg.Add(1)
201201
go func() {
202202
defer mptWg.Done()
203203
for trieIt.Next() {
204-
if trieIt.Key[0] >= stopKey {
204+
if int(trieIt.Key[0]) >= stopKey {
205205
break
206206
}
207207

0 commit comments

Comments
 (0)