code: func notifyBlock(chain ChainSource, ro *rescanOptions,
  	curHeader wire.BlockHeader, curStamp waddrmgr.BlockStamp,
  	scanning bool) error {
  
  	// Find relevant transactions based on watch list. If scanning is
  	// false, we can safely assume this block has no relevant transactions.
  	var relevantTxs []*btcutil.Tx
  	if len(ro.watchList) != 0 && scanning {
  		// If we have a non-empty watch list, then we need to see if it
  		// matches the rescan's filters, so we get the basic filter
  		// from the DB or network.
  		matched, err := blockFilterMatches(chain, ro, &curStamp.Hash)
  		if err != nil {
  			return err
  		}
  
  		if matched {
  			relevantTxs, err = extractBlockMatches(
  				chain, ro, &curStamp,
  			)
  			if err != nil {
  				return err
  			}
  		}
  	}
  
  	if ro.ntfn.OnFilteredBlockConnected != nil {
  		ro.ntfn.OnFilteredBlockConnected(curStamp.Height, &curHeader,
  			relevantTxs)
  	}
  
  	if ro.ntfn.OnBlockConnected != nil {
  		ro.ntfn.OnBlockConnected(&curStamp.Hash,
  			curStamp.Height, curHeader.Timestamp)
  	}
  
  	return nil
  }
docs: // notifyBlock calls appropriate listeners based on the block filter.