This commit is contained in:
Roy Crihfield 2020-08-23 22:11:32 -05:00
parent 6d20ef7c3b
commit f8962c6c58

View File

@ -26,6 +26,7 @@ import (
"github.com/ethereum/go-ethereum/core/state"
)
// Simplified trie node iterator
type NodeIterator interface {
Next(bool) bool
Error() error
@ -37,11 +38,10 @@ type NodeIterator interface {
type prefixBoundIterator struct {
current trie.NodeIterator
endKey []byte
// endHash common.Hash
}
func (it *prefixBoundIterator) Next(descend bool) bool {
if it.endKey == nil { // todo: want?
if it.endKey == nil {
return it.current.Next(descend)
}
cmp := bytes.Compare(it.current.Path(), it.endKey) // stop before endKey