code: func (msg *MsgTx) TxHash() chainhash.Hash {
  	// Encode the transaction and calculate double sha256 on the result.
  	// Ignore the error returns since the only way the encode could fail
  	// is being out of memory or due to nil pointers, both of which would
  	// cause a run-time panic.
  	buf := bytes.NewBuffer(make([]byte, 0, msg.SerializeSizeStripped()))
  	_ = msg.SerializeNoWitness(buf)
  	return chainhash.DoubleHashH(buf.Bytes())
  }
docs: // TxHash generates the Hash for the transaction.