From 102ca293f6cbdbda19c21697c25b66febc1a1bb9 Mon Sep 17 00:00:00 2001 From: Olaoluwa Osuntokun Date: Thu, 14 Jun 2018 17:50:39 -0700 Subject: [PATCH] blockchain: pass in prevScript for constructing the basic filter --- blockchain/indexers/cfindex.go | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/blockchain/indexers/cfindex.go b/blockchain/indexers/cfindex.go index c16c3a08..f8081be8 100644 --- a/blockchain/indexers/cfindex.go +++ b/blockchain/indexers/cfindex.go @@ -201,7 +201,12 @@ func storeFilter(dbTx database.Tx, block *btcutil.Block, f *gcs.Filter, func (idx *CfIndex) ConnectBlock(dbTx database.Tx, block *btcutil.Block, stxos []blockchain.SpentTxOut) error { - f, err := builder.BuildBasicFilter(block.MsgBlock()) + prevScripts := make([][]byte, len(stxos)) + for i, stxo := range stxos { + prevScripts[i] = stxo.PkScript + } + + f, err := builder.BuildBasicFilter(block.MsgBlock(), prevScripts) if err != nil { return err }