code: func (db *MemDB) Txn(write bool) *Txn {
  	if write {
  		db.writer.Lock()
  	}
  	txn := &Txn{
  		db:      db,
  		write:   write,
  		rootTxn: db.getRoot().Txn(),
  	}
  	return txn
  }
docs: // Txn is used to start a new transaction, in either read or write mode.
  // There can only be a single concurrent writer, but any number of readers.