func (a *managedAddress) Used(ns walletdb.ReadBucket) bool {
	return a.manager.fetchUsed(ns, a.AddrHash())
}
Used returns true if the address has been used in a transaction.

This is part of the ManagedAddress interface implementation.
package waddrmgr
import (
	"encoding/hex"
	"fmt"
	"sync"
	"github.com/gcash/bchd/bchec"
	"github.com/gcash/bchutil"
	"github.com/gcash/bchutil/hdkeychain"
	"github.com/gcash/bchwallet/internal/zero"
	"github.com/gcash/bchwallet/walletdb"
)
type AddressType uint8
const (
	PubKeyHash AddressType = iota
	Script
	RawPubKey
)
type ManagedAddress interface {
	Account() uint32
	Address() bchutil.Address
	AddrHash() []byte
	Imported() bool
	Internal() bool
	Compressed() bool
	Used(ns walletdb.ReadBucket) bool
	AddrType() AddressType
}
type ManagedPubKeyAddress interface {
	ManagedAddress
	PubKey() *bchec.PublicKey
	ExportPubKey() string
	PrivKey() (*bchec.PrivateKey, error)
	ExportPrivKey() (*bchutil.WIF, error)
	DerivationInfo() (KeyScope, DerivationPath, bool)
}
type ManagedScriptAddress interface {
	ManagedAddress
	Script() ([]byte, error)
}
type managedAddress struct {
	manager          *ScopedKeyManager
	derivationPath   DerivationPath
	address          bchutil.Address
	imported         bool
	internal         bool
	compressed       bool
	used             bool
	addrType         AddressType
	pubKey           *bchec.PublicKey
	privKeyEncrypted []byte
	privKeyCT        []byte  
	privKeyMutex     sync.Mutex
}
var _ ManagedPubKeyAddress = (*managedAddress)(nil)
func (a *managedAddress) unlock(key EncryptorDecryptor) ([]byte, error) {
	a.privKeyMutex.Lock()
	defer a.privKeyMutex.Unlock()
	if len(a.privKeyCT) == 0 {
		privKey, err := key.Decrypt(a.privKeyEncrypted)
		if err != nil {
			str := fmt.Sprintf("failed to decrypt private key for "+
				"%s", a.address)
			return nil, managerError(ErrCrypto, str, err)
		}
		a.privKeyCT = privKey
	}
	privKeyCopy := make([]byte, len(a.privKeyCT))
	copy(privKeyCopy, a.privKeyCT)
	return privKeyCopy, nil
}
func (a *managedAddress) lock() {
	a.privKeyMutex.Lock()
	zero.Bytes(a.privKeyCT)
	a.privKeyCT = nil
	a.privKeyMutex.Unlock()
}
func (a *managedAddress) Account() uint32 {
	return a.derivationPath.Account
}
func (a *managedAddress) AddrType() AddressType {
	return a.addrType
}
func (a *managedAddress) Address() bchutil.Address {
	return a.address
}
func (a *managedAddress) AddrHash() []byte {
	var hash []byte
	switch n := a.address.(type) {
	case *bchutil.AddressPubKeyHash:
		hash = n.Hash160()[:]
	case *bchutil.AddressScriptHash:
		hash = n.Hash160()[:]
	}
	return hash
}
func (a *managedAddress) Imported() bool {
	return a.imported
}
func (a *managedAddress) Internal() bool {
	return a.internal
}
func (a *managedAddress) Compressed() bool {
	return a.compressed
}