code: func (m *wsNotificationManager) addSpentRequests(opMap map[wire.OutPoint]map[chan struct{}]*wsClient,
  	wsc *wsClient, ops []*wire.OutPoint) {
  
  	for _, op := range ops {
  		// Track the request in the client as well so it can be quickly
  		// be removed on disconnect.
  		wsc.spentRequests[*op] = struct{}{}
  
  		// Add the client to the list to notify when the outpoint is seen.
  		// Create the list as needed.
  		cmap, ok := opMap[*op]
  		if !ok {
  			cmap = make(map[chan struct{}]*wsClient)
  			opMap[*op] = cmap
  		}
  		cmap[wsc.quit] = wsc
  	}
  
  	// Check if any transactions spending these outputs already exists in
  	// the mempool, if so send the notification immediately.
  	spends := make(map[chainhash.Hash]*btcutil.Tx)
  	for _, op := range ops {
  		spend := m.server.cfg.TxMemPool.CheckSpend(*op)
  		if spend != nil {
  			rpcsLog.Debugf("Found existing mempool spend for "+
  				"outpoint<%v>: %v", op, spend.Hash())
  			spends[*spend.Hash()] = spend
  		}
  	}
  
  	for _, spend := range spends {
  		m.notifyForTx(opMap, nil, spend, nil)
  	}
  }
docs: // addSpentRequests modifies a map of watched outpoints to sets of websocket
  // clients to add a new request watch all of the outpoints in ops and create
  // and send a notification when spent to the websocket client wsc.