blockchain: pass in prevScript for constructing the basic filter

This commit is contained in:
Olaoluwa Osuntokun 2018-06-14 17:50:39 -07:00
parent 576800a99e
commit 102ca293f6
No known key found for this signature in database
GPG key ID: 964EA263DD637C21

View file

@ -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
}