// AddAddress adds a new address to the filter.
AddAddress adds a new address to the filter.
// AddAddress adds a new address to the filter .
func (f *txFilter) AddAddress(addr bchutil.Address) {
	switch a := addr.(type) {
	case *bchutil.AddressPubKeyHash:
		f.pubKeyHashes[*a.Hash160()] = struct{}{}
	case *bchutil.AddressScriptHash:
		f.scriptHashes[*a.Hash160()] = struct{}{}
	case *bchutil.AddressPubKey:
		pubkeyBytes := a.ScriptAddress()
		switch len(pubkeyBytes) {
		case 33: 
			var compressedPubkey [33]byte
			copy(compressedPubkey[:], pubkeyBytes)
			f.compressedPubKeys[compressedPubkey] = struct{}{}
		case 65: 
			var uncompressedPubkey [65]byte
			copy(uncompressedPubkey[:], pubkeyBytes)
			f.uncompressedPubKeys[uncompressedPubkey] = struct{}{}
		}
	default:
		addrStr := addr.EncodeAddress()
		log.Infof("Unknown address type: %v", addrStr)
		f.fallbacks[addrStr] = struct{}{}
	}
}
func ( f * txFilter ) AddAddress ( addr bchutil . Address ) { switch a := addr . ( type ) { case * bchutil . AddressPubKeyHash : f . pubKeyHashes [ * a . Hash160 ( ) ] = struct { } { } case * bchutil . AddressScriptHash : f . scriptHashes [ * a . Hash160 ( ) ] = struct { } { } case * bchutil . AddressPubKey : pubkeyBytes := a . ScriptAddress ( ) switch len ( pubkeyBytes ) { case 33 : var compressedPubkey [ 33 ] byte copy ( compressedPubkey [ : ] , pubkeyBytes ) f . compressedPubKeys [ compressedPubkey ] = struct { } { } case 65 : var uncompressedPubkey [ 65 ] byte copy ( uncompressedPubkey [ : ] , pubkeyBytes ) f . uncompressedPubKeys [ uncompressedPubkey ] = struct { } { } } default : addrStr := addr . EncodeAddress ( ) log . Infof ( " " , addrStr ) f . fallbacks [ addrStr ] = struct { } { } } }
AddAddress adds a new address to the filter.
AddAddress adds a new address to the filter .
// Compressed // Uncompressed // A new address type must have been added.  Use encoded // payment address string as a fallback until a fast path // is added.