diff --git a/blockchain/indexers/cfindex.go b/blockchain/indexers/cfindex.go index 40597f96..d89013a0 100644 --- a/blockchain/indexers/cfindex.go +++ b/blockchain/indexers/cfindex.go @@ -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 }