You can still have an erection once dead
A death erection (sometimes referred to as "angel lust") is a post-mortem erection which occurs when a male individual dies vertically or face-down with the cadaver remaining in this position. During life, the pumping of blood by the heart ensures a relatively even distribution around the blood vessels of the human body. Once this mechanism has ended, only the force of gravity acts upon the blood. As with any mass, the blood settles at the lowest point of the body and causes edema or swelling to occur; the discoloration caused by this is called lividity.
If an individual dies vertically such as in a hanging, the blood will settle in the legs and pool at the feet. The pressure will be greatest as the weight of the blood pushes down. This causes the blood vessels and tissues in the feet to engorge to their greatest elastic capacity and hold the greatest volume of blood possible. This effect occurs right up the legs although to a lesser extent than the feet and is also notable at the waist. The blood which remains in the torso attempts to move to a lower position due to gravity, and as the blood in the waist (which cannot move down due to the legs being full) causes the penis, consisting of erectile tissue, to fill with blood and expand. This is the death erection. As long as the body remains in this position the effect will continue.