func (db *LDBDatabase) NewIterator() iterator.Iterator {
	it := db.db.NewIterator(nil, nil)
	runtime.SetFinalizer(it, func() { it.Release() })
	return it
}
NewIterator creates a new leveldb iterator struct compliant with Iterator interface
import (
	"fmt"
	"runtime"
	"strconv"
	"strings"
	"sync"
	"time"
	"github.com/libonomy/libonomy-p2p/log"
	"github.com/syndtr/goleveldb/leveldb"
	"github.com/syndtr/goleveldb/leveldb/errors"
	"github.com/syndtr/goleveldb/leveldb/filter"
	"github.com/syndtr/goleveldb/leveldb/iterator"
	"github.com/syndtr/goleveldb/leveldb/opt"
	"github.com/syndtr/goleveldb/leveldb/util"
)
const (
	writePauseWarningThrottler = 1 * time.Minute
)
var ErrNotFound = errors.ErrNotFound
type LDBDatabase struct {
	fn string       
	db *leveldb.DB  
	quitLock sync.Mutex       
	quitChan chan chan error  
	log log.Log  
}
func NewLDBDatabase(file string, cache int, handles int, logger log.Log) (*LDBDatabase, error) {
	if cache < 16 {
		cache = 16
	}
	if handles < 16 {
		handles = 16
	}
	logger.Info("Allocated cache and file handles", "cache", cache, "handles", handles)
	db, err := leveldb.OpenFile(file, &opt.Options{
		OpenFilesCacheCapacity: handles,
		BlockCacheCapacity:     cache / 2 * opt.MiB,
		WriteBuffer:            cache / 4 * opt.MiB,  
		Filter:                 filter.NewBloomFilter(10),
	})
	if _, corrupted := err.(*errors.ErrCorrupted); corrupted {
		db, err = leveldb.RecoverFile(file, nil)
	}
	if err != nil {
		return nil, err
	}
	return &LDBDatabase{
		fn:  file,
		db:  db,
		log: logger,
	}, nil
}
func (db *LDBDatabase) Path() string {
	return db.fn
}
func (db *LDBDatabase) Put(key []byte, value []byte) error {
	return db.db.Put(key, value, nil)
}
func (db *LDBDatabase) Has(key []byte) (bool, error) {
	return db.db.Has(key, nil)
}
func (db *LDBDatabase) Get(key []byte) ([]byte, error) {
	dat, err := db.db.Get(key, nil)
	if err != nil {
		return nil, err
	}
	return dat, nil
}
func (db *LDBDatabase) Delete(key []byte) error {
	return db.db.Delete(key, nil)
}