code: func (f *FilterStore) PutFilter(hash *chainhash.Hash,
  	filter *gcs.Filter, fType FilterType) error {
  
  	return walletdb.Update(f.db, func(tx walletdb.ReadWriteTx) error {
  		filters := tx.ReadWriteBucket(filterBucket)
  
  		var targetBucket walletdb.ReadWriteBucket
  		switch fType {
  		case RegularFilter:
  			targetBucket = filters.NestedReadWriteBucket(regBucket)
  		default:
  			return fmt.Errorf("unknown filter type: %v", fType)
  		}
  
  		if filter == nil {
  			return targetBucket.Put(hash[:], nil)
  		}
  
  		bytes, err := filter.NBytes()
  		if err != nil {
  			return err
  		}
  
  		return targetBucket.Put(hash[:], bytes)
  	})
  }
docs: // PutFilter stores a filter with the given hash and type to persistent
  // storage.
  //
  // NOTE: This method is a part of the FilterDatabase interface.