core/state/snapshot: make difflayer account iterator seek operation inclusive

This commit is contained in:
Martin Holst Swende
2020-04-21 16:26:02 +02:00
parent 7599999dcd
commit c036fe35a8
2 changed files with 18 additions and 5 deletions

View File

@ -70,7 +70,7 @@ func (dl *diffLayer) AccountIterator(seek common.Hash) AccountIterator {
// Seek out the requested starting account
hashes := dl.AccountList()
index := sort.Search(len(hashes), func(i int) bool {
return bytes.Compare(seek[:], hashes[i][:]) < 0
return bytes.Compare(seek[:], hashes[i][:]) <= 0
})
// Assemble and returned the already seeked iterator
return &diffAccountIterator{