code: func GetTransactionWeight(tx *btcutil.Tx) int64 {
  	msgTx := tx.MsgTx()
  
  	baseSize := msgTx.SerializeSizeStripped()
  	totalSize := msgTx.SerializeSize()
  
  	// (baseSize * 3) + totalSize
  	return int64((baseSize * (WitnessScaleFactor - 1)) + totalSize)
  }
docs: // GetTransactionWeight computes the value of the weight metric for a given
  // transaction. Currently the weight metric is simply the sum of the
  // transactions's serialized size without any witness data scaled
  // proportionally by the WitnessScaleFactor, and the transaction's serialized
  // size including any witness data.