// AddRPCFilter adds all filter properties from the pb.TransactionFilter
// to the filter.
AddRPCFilter adds all filter properties from the pb.TransactionFilter
to the filter.
// AddRPCFilter adds all filter properties from the pb . TransactionFilter // to the filter .
func (f *txFilter) AddRPCFilter(rpcFilter *pb.TransactionFilter, params *chaincfg.Params) error {
	if rpcFilter == nil {
		return nil
	}
	for _, op := range rpcFilter.GetOutpoints() {
		hash, err := chainhash.NewHash(op.GetHash())
		if err != nil {
			return err
		}
		f.AddOutpoint(wire.OutPoint{Hash: *hash, Index: op.GetIndex()})
	}
	for _, addrStr := range rpcFilter.GetAddresses() {
		addr, err := bchutil.DecodeAddress(addrStr, params)
		if err != nil {
			return fmt.Errorf("Unable to decode address '%v': %v", addrStr, err)
		}
		f.AddAddress(addr)
	}
	for _, dataElement := range rpcFilter.GetDataElements() {
		f.AddDataElement(dataElement)
	}
	f.matchAll = rpcFilter.AllTransactions
	return nil
}
func ( f * txFilter ) AddRPCFilter ( rpcFilter * pb . TransactionFilter , params * chaincfg . Params ) error { if rpcFilter == nil { return nil } for _ , op := range rpcFilter . GetOutpoints ( ) { hash , err := chainhash . NewHash ( op . GetHash ( ) ) if err != nil { return err } f . AddOutpoint ( wire . OutPoint { Hash : * hash , Index : op . GetIndex ( ) } ) } for _ , addrStr := range rpcFilter . GetAddresses ( ) { addr , err := bchutil . DecodeAddress ( addrStr , params ) if err != nil { return fmt . Errorf ( " " , addrStr , err ) } f . AddAddress ( addr ) } for _ , dataElement := range rpcFilter . GetDataElements ( ) { f . AddDataElement ( dataElement ) } f . matchAll = rpcFilter . AllTransactions return nil }
AddRPCFilter adds all filter properties from the pb.TransactionFilter
to the filter.
AddRPCFilter adds all filter properties from the pb . TransactionFilter to the filter .
// Add outpoints. // Interpret and add addresses. // Add data elements