Viagra was discovered by accident while searching for a better blood pressure lowering medication.
And that was one helluva net-positive trade off right there, wasn’t it? LOL!
After a clinical trial (for reduction of blood pressure) comparing what would later be known as Viagra with a placebo, a number of patients on the Viagra side went to their doctors and said "Er, well, er, could we possibly, er, keep taking this , er, drug?"
The researchers, after a few questions, found out why the patients wanted to continue taking it, and the rest is history.