The past two nights in a row i've woken up during the night with a massive erection. It was almost painful and I felt this weird pressure in my testicles and abdomen. I tried using the bathroom both times but couldn't relieve any pressure and the erection would not go away. I eventually went back to sleep and have had normal days both times after those nights.

What is going on? Could it have anything to do with the fact that I have quit masturbation for one month now? I haven't had any nocturnal emissions.