code: func putFilter(bucket walletdb.ReadWriteBucket, hash *chainhash.Hash,
  	filter *gcs.Filter) error {
  
  	if filter == nil {
  		return bucket.Put(hash[:], nil)
  	}
  
  	bytes, err := filter.NBytes()
  	if err != nil {
  		return err
  	}
  
  	return bucket.Put(hash[:], bytes)
  }
docs: // putFilter stores a filter in the database according to the corresponding
  // block hash. The passed bucket is expected to be the proper bucket for the
  // passed filter type.