mirror of
https://github.com/LBRYFoundation/lbcd.git
synced 2025-08-23 17:47:24 +00:00
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))
|
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 {
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue