diff --git a/db/go_level_db.go b/db/go_level_db.go index f3ed79e30..4abd76112 100644 --- a/db/go_level_db.go +++ b/db/go_level_db.go @@ -118,12 +118,12 @@ func (db *GoLevelDB) Stats() map[string]string { } type goLevelDBIterator struct { - iterator.Iterator + source iterator.Iterator } // Key returns a copy of the current key. func (it *goLevelDBIterator) Key() []byte { - key := it.Key() + key := it.source.Key() k := make([]byte, len(key)) copy(k, key) @@ -132,13 +132,25 @@ func (it *goLevelDBIterator) Key() []byte { // Value returns a copy of the current value. func (it *goLevelDBIterator) Value() []byte { - val := it.Value() + val := it.source.Value() v := make([]byte, len(val)) copy(v, val) return v } +func (it *goLevelDBIterator) Error() error { + return it.source.Error() +} + +func (it *goLevelDBIterator) Next() bool { + return it.source.Next() +} + +func (it *goLevelDBIterator) Release() { + it.source.Release() +} + func (db *GoLevelDB) Iterator() Iterator { return &goLevelDBIterator{db.db.NewIterator(nil, nil)} } diff --git a/db/mem_db.go b/db/mem_db.go index 55d594fa6..077427509 100644 --- a/db/mem_db.go +++ b/db/mem_db.go @@ -103,7 +103,6 @@ func (it *memDBIterator) Value() []byte { func (it *memDBIterator) Release() { it.db = nil it.keys = nil - return } func (it *memDBIterator) Error() error {