It’s wasting to practice if your mind is in bad state though you are trying to sit resisting with painful legs
What kind of motivation you should have for that kind of activity. We, practitioners, understand Dharma is good intention, pure motivation.