blockchain/indexers: proper handling of empty filters
This commit is contained in:
parent
e0943a84bd
commit
9b9ef42f8a
1 changed files with 6 additions and 2 deletions
|
@ -182,7 +182,11 @@ func storeFilter(dbTx database.Tx, block *btcutil.Block, f *gcs.Filter,
|
|||
|
||||
// Start by storing the filter.
|
||||
h := block.Hash()
|
||||
err := dbStoreFilter(dbTx, fkey, h, f.NBytes())
|
||||
var basicFilterBytes []byte
|
||||
if f != nil {
|
||||
basicFilterBytes = f.NBytes()
|
||||
}
|
||||
err := dbStoreFilter(dbTx, fkey, h, basicFilterBytes)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
@ -210,7 +214,7 @@ func (idx *CfIndex) ConnectBlock(dbTx database.Tx, block *btcutil.Block,
|
|||
view *blockchain.UtxoViewpoint) error {
|
||||
|
||||
f, err := builder.BuildBasicFilter(block.MsgBlock())
|
||||
if err != nil {
|
||||
if err != nil && err != gcs.ErrNoData {
|
||||
return err
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue