code: func (db *DB) removeTx(tx *Tx) {
  	// Release the read lock on the mmap.
  	db.mmaplock.RUnlock()
  
  	// Use the meta lock to restrict access to the DB object.
  	db.metalock.Lock()
  
  	// Remove the transaction.
  	for i, t := range db.txs {
  		if t == tx {
  			last := len(db.txs) - 1
  			db.txs[i] = db.txs[last]
  			db.txs[last] = nil
  			db.txs = db.txs[:last]
  			break
  		}
  	}
  	n := len(db.txs)
  
  	// Unlock the meta pages.
  	db.metalock.Unlock()
  
  	// Merge statistics.
  	db.statlock.Lock()
  	db.stats.OpenTxN = n
  	db.stats.TxStats.add(&tx.stats)
  	db.statlock.Unlock()
  }
docs: // removeTx removes a transaction from the database.