At 64, I've been there with the prostate cancer and I also have chronic leukemia which adds yet another joy of complications to my life. I ride fairly hard on a daily basis, 6 days a week (used to be 7). I used to get leg cramps almost every night when I was asleep and repositioned myself to the point that it would wake me up. I talked with my doctor and started taking potassium supplements (99 mg) on a daily basis and I've been doing that for around 4 months and have not had a leg cramp since; while riding or when sleeping. I get the supplements at Sam's Club for dirt cheap and although they aren't as tasty as a banana a day, they are much cheaper.
I also keep myself well hydrated when on rides and on long rides (50 + miles), I take a third water bottle with a mixture of water and Hammer Perpeteum. Perpeteum is a used for quick recovery after rides and during rides helps keep lactic acid from forming, which is a main reason for leg cramps while riding. My second water bottle is a water and electrolyte mixture similar to Gator Aid. I seldom use the Perpeteum or electrolytes on rides less then 40 miles unless it is very hot or I am going to do a fast group ride with very few stops.
__________________
HCFR Cycling Team
Ride Safe ... Ride Hard ... Ride Daily
2017 Colnago C-RS
2012 Colnago Ace
2010 Giant Cypress