Store filter in a db block index

This commit is contained in:
pedro martelletto 2017-01-11 16:29:32 +00:00 committed by Olaoluwa Osuntokun
parent b2990e7999
commit 620ad5b6fb

View file

@ -102,7 +102,14 @@ func (idx *CBFIndex) ConnectBlock(dbTx database.Tx, block *btcutil.Block, view *
binary.BigEndian.PutUint32(key[i:], uint32(0xcafebabe))
}
_, err := gcs.BuildGCSFilter(P, key, txHashes)
filter, err := gcs.BuildGCSFilter(P, key, txHashes)
if err != nil {
return err
}
meta := dbTx.Metadata()
hashIndex := meta.Bucket(cbfIndexKey)
err = hashIndex.Put(block.Hash().CloneBytes(), filter.Bytes())
if err != nil {
return err
}