code: func rescanBlockFilter(filter *wsClientFilter, block *btcutil.Block, params *chaincfg.Params) []string {
  	var transactions []string
  
  	filter.mu.Lock()
  	for _, tx := range block.Transactions() {
  		msgTx := tx.MsgTx()
  
  		// Keep track of whether the transaction has already been added
  		// to the result.  It shouldn't be added twice.
  		added := false
  
  		// Scan inputs if not a coinbase transaction.
  		if !blockchain.IsCoinBaseTx(msgTx) {
  			for _, input := range msgTx.TxIn {
  				if !filter.existsUnspentOutPoint(&input.PreviousOutPoint) {
  					continue
  				}
  				if !added {
  					transactions = append(
  						transactions,
  						txHexString(msgTx))
  					added = true
  				}
  			}
  		}
  
  		// Scan outputs.
  		for i, output := range msgTx.TxOut {
  			_, addrs, _, err := txscript.ExtractPkScriptAddrs(
  				output.PkScript, params)
  			if err != nil {
  				continue
  			}
  			for _, a := range addrs {
  				if !filter.existsAddress(a) {
  					continue
  				}
  
  				op := wire.OutPoint{
  					Hash:  *tx.Hash(),
  					Index: uint32(i),
  				}
  				filter.addUnspentOutPoint(&op)
  
  				if !added {
  					transactions = append(
  						transactions,
  						txHexString(msgTx))
  					added = true
  				}
  			}
  		}
  	}
  	filter.mu.Unlock()
  
  	return transactions
  }
docs: // rescanBlockFilter rescans a block for any relevant transactions for the
  // passed lookup keys. Any discovered transactions are returned hex encoded as
  // a string slice.
  //
  // NOTE: This extension is ported from github.com/decred/dcrd