func (s *Store) ImportCFiltersV2(dbtx walletdb.ReadWriteTx, startHeight int32, filterData [][]byte) error {
	ns := dbtx.ReadWriteBucket(wtxmgrBucketKey)
	blockIter := makeReadBlockIterator(ns, startHeight)
	for i, fd := range filterData {
		if !blockIter.next() {
			return errors.E(errors.NotExist, errors.Errorf("block height of %d unknown", startHeight+int32(i)))
		}
		_, err := gcs2.FromBytesV2(blockcf2.B, blockcf2.M, fd)
		if err != nil {
			return err
		}
		bh := blockIter.elem.Hash
		header, err := fetchRawBlockHeader(ns, keyBlockHeader(&bh))
		if err != nil {
			return err
		}
		merkleRoot := extractBlockHeaderMerkleRoot(header)
		var bcf2Key [gcs2.KeySize]byte
		copy(bcf2Key[:], merkleRoot[:])
		err = putRawCFilter(ns, bh[:], valueRawCFilter2(bcf2Key, fd))
		if err != nil {
			return err
		}
	}
	return nil
}
ImportCFiltersV2 imports the given list of cfilters into the wallet,
starting at the provided block height.
package udb
import (
	"decred.org/dcrwallet/v2/errors"
	"decred.org/dcrwallet/v2/wallet/walletdb"
	"github.com/decred/dcrd/chaincfg/chainhash"
	gcs2 "github.com/decred/dcrd/gcs/v3"
	"github.com/decred/dcrd/gcs/v3/blockcf2"
)
func (s *Store) CFilterV2(dbtx walletdb.ReadTx, blockHash *chainhash.Hash) ([gcs2.KeySize]byte, *gcs2.FilterV2, error) {
	ns := dbtx.ReadBucket(wtxmgrBucketKey)
	k, v, err := fetchRawCFilter2(ns, blockHash[:])
	if err != nil {
		return [16]byte{}, nil, err
	}
	vc := make([]byte, len(v))  
	copy(vc, v)
	filter, err := gcs2.FromBytesV2(blockcf2.B, blockcf2.M, vc)
	if err != nil {
		return k, nil, err
	}
	return k, filter, err
}