Store filter in a db block index
This commit is contained in:
parent
b2990e7999
commit
620ad5b6fb
1 changed files with 8 additions and 1 deletions
|
@ -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
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue